forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

A maze for DS

I was looking for a lost piece of experimental code to possibly tune my mods with, and while browsing the backup folders I stumbled upon an old trial about creating/importing labyrinths for the siege editor.

Unfortunately there were no comment why I didn't proceed this idea at that time, so couldn't resist to do some additional tunings to make a prefab for the Siege Editor with help of an auxiliary grid and text table:

There are 4 types of nodes intended for the labyrinth - floor, wall, L-shaped corner, small 'walk-around' (convex) corner. 4 letters/keys are used for each node type - for example q, w, e, and r for the L-shaped corner depending on its placement/rotation.

q y y a 3 s y y y y y y y w q y y y w
v d c c c c c c c c f d f x v d f 1 x
v s y y w q y y y y a x v x r e v d e
r c c f x v d c c c c e v x q y a s w
q y y a x v x q w q y y a x v d c f x
v d c f x v x v x v d c c e v x q a x
v s w v s a s a x v s y y y a x v d e
r f x r c c c f x r c c f d c e v s w
q a x q y y w v x q y y a x q w r c e
v d e v d f x v x r c c f x v s y y w
v s y a x v x v x q y y a x v d c f x
r c c c e v x v x v d c c e v x q a x
q w q y y a x v x v s w q y a x v d e
v s a d f d e v x r f x v d c e v s w
v d c e v x q a s y a x v x q w r f x
v x q y a x r c c c c e v x v s y a x
v x r c c e q w q y y w v x v d c c e
v s y y y y a s a d f s a x v s y y w
r c c c c c c c c e r c c e r f 4 d e

As experienced creating this table is the most vulnerable and painful step (...dreaming of any OCR tool to do this). However a PHP script turned it then into a prefab so the Siege Editor could read it:

Actually I never passed such a labyrinth in-game so far. One reason for suspending this idea probably was the path-finding in DS - an autopilot widely would vitiate a maze, unless doors, barricades, etc. will be added too. However some rework (start and finish area, torches, spider webs, etc.) would be needed anyway to make it an attractive environment.

blogs: 

Comments

That is really super KillerGremal. I am just amazed at the maze and your mind as well.

Elf

so thats how gpg came up with the pit of despair... damn, the headache it caused me trying to complete it and the even bigger headache + heartache AFTER i completed it... i err... what?!

anyway, i think u overestimated how good the pathfinding system is in ds. u can easily defeat it by using maze node design techniques gpg used for the pit of despair.

usage of some doorways. the pathfinding stumbles on narrow doorways and pathways.
reducing the frustum size helps too as well as making it really dark. i.e. very close black fog.

thats some of the design guidelines i can think of now. will let u know if i cook up more. lol

bare_elf wrote:
That is really super KillerGremal. I am just amazed at the maze and your mind as well.

Elf

Thanks, however if my mind was faster, it skipped that painful approach of creating a text table right from the beginning. Typing manually these text tables is just too painful and vulnerable.
I almost gave it up, but last weekend I remembered the function ImageColorAt which (also) can be used to find out if a point is black or white.

Like this it was possible to transform this maze with help of a little auxiliary image...
(flipped by 180°)
...into a prefab for the SE where it will look like this:

 

Interesting is what happens if this aux. image gets upscaled by 2 (with a little translation/crop):

'Amazingly' the walls and floors get 2x as strong/broad as well:

 

 

Lady Femme wrote:
so thats how gpg came up with the pit of despair... damn, the headache it caused me trying to complete it and the even bigger headache + heartache AFTER i completed it... i err... what?!

anyway, i think u overestimated how good the pathfinding system is in ds. u can easily defeat it by using maze node design techniques gpg used for the pit of despair.

usage of some doorways. the pathfinding stumbles on narrow doorways and pathways.
reducing the frustum size helps too as well as making it really dark. i.e. very close black fog.

thats some of the design guidelines i can think of now. will let u know if i cook up more. lol

Thanks for the hints!
Breakable barricades or path-blocking objects generally (there's actually a blocker de-blocking on activation) could be used too I've thought, but as tested that may not be necessary specially for labyrinths with >2000 nodes. The DS path-finding seems to be able to lead the player around one or the other corner that are not on the screen (yet) but it couldn't resolved larger parts of the maze.

There is now a primitive way for everyone to turn a structure image of a labyrinth into a simple prefab for the SE1/2:

Example:

Assumed you have uploaded anywhere a black+white image of a labyrinth...
http://postimg.org/image/vnlez4zmv/3ad853e6/

...you (easily) can get the 'direct link' to the image (other hosters may work too, however it must be a direct image link)...
http://s23.postimg.org/vnlez4zmv/lab_test1.png

...then take this image link and copy it onto the follow url...
http://dungeonsiege2.net/ds2fun/maze/?img=

The result will be the following link, copy it into the address bar of your browser and press enter.
http://dungeonsiege2.net/ds2fun/maze/?img=http://s23.postimg.org/vnlez4zmv/lab_test1.png

 
 

Remarks+Restrictions:

  • If it takes more than 30 seconds to get the prefab file from the server please check if the file is complete (usually it's complete if the first char of the last row is such a } curly bracket).
  • The structure image has to be an PNG image with 256 colors (grey-scaled or a B/W image of 8 bit color-depth).
  • By default 4 pixels (2x2) are used to represent a DS node. To change this (for example) '&pixels_per_node=144' can be added onto the final link to treat (here) 12x12 pixels for a node. More pixels per node can handle grey tones some better (if you don't have a clear B/W image).
  • The prefab is currently made of DS1 nodes. Enusure you have the terrain pack installed.
  • The SE probably will crash if your prefab will contain more than 2700 nodes.
  • If you need to cut the structure image in pieces (due to the node/prefab limit), the option '&outward_torches=1' (by default it's 0/false) may help.
  • A prefab can be edited manually with any text editor. So node set(*), texture abbreviations and position data can be exchanged quite easily.
  • Alternate texture abbreviations (lower part of that post) also can be specified with '&tex=...' (general) and '&tex2=...' (impassable, inwards). Remind however not all texture sets will fit for all nodes.
  • To make the SE recompile an edited prefab (while the SE was running) just select 1 node an save it as prefab (this will recompile the other prefabs too).

 
 

*: other possible node sets found so far (.SNO files):

- t_dgn01_cnr_ccav-4a.sno
- t_dgn01_cnr_cnvx-4a.sno
- t_dgn01_wal_4a.sno
- t_dgn01_flr_04x04a.sno
- t_dgn02_cnr_04b-ccav-v1.sno / t_dgn02_cnr_04b-ccav-v0.sno
- t_dgn02_cnr_04b-cnvx-v0.sno
- t_dgn02_wal_04b-v0.sno
- t_dgn02_flr_04x04-v0.sno

Very cool work KG, for getting a nice dungeon together fast. I found a nice generator for Pathfinder RPG that may be able to output something that can be read by your tool, at least after a little graphic editing:
http://donjon.bin.sh/pathfinder/dungeon/

one thing of note with that generator are the numerous paramters for making a complex dungeon drawing. This generator also creates rooms, doors or many types and even lists of encounters along with traps.

FreeLikeGNU wrote:
Very cool work KG, for getting a nice dungeon together fast. I found a nice generator for Pathfinder RPG that may be able to output something that can be read by your tool, at least after a little graphic editing:
http://donjon.bin.sh/pathfinder/dungeon/

one thing of note with that generator are the numerous paramters for making a complex dungeon drawing. This generator also creates rooms, doors or many types and even lists of encounters along with traps.

I must have missed that... *cough* :o
...but this generator is quite cool indeed. Perhaps I can pick up some ideas once for the generator here.