Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - lithander

Pages: [1]
1
Programming / L-Systems
« on: March 26, 2013, 11:58:52 AM »
A while ago I started to look into L-Systems because their emergent properties really fascinated me. I like how simple rules produce great complexity. There's this great book The Algorithmic Beauty of Plants on modelling plant development through L-Systems. Once you get to parametric, context-sensitve L-Systems the technique really gets powerful beyond "some kind of recursion".

I started writing a script-interpreter so I could try and experiment with the productions from the book. In my script I don't treat L-Systems as formal grammar where commands that control the turtle are symbols in the alphabet. Instead the strings of symbols the L-Systems produces map to named sequences of commands, not unlike what you'd expect from a simple imperative programming language. So, basically you can define procedures and generate procedure calls through L-Systems. But ultimately it's the same thing.

It's fun to play with but I'm not very interested in modelling plants. Have you guys ever used L-Systems for something interesting? I'm trying to come up with ideas how this could be used for procedurally generating content for games (beyond plants) like generating dungeons or citys, monsters, behavior, talent trees, branching storylines... (I'm just making things up on the spot)

2
Programming / Torso & Head direction
« on: December 07, 2012, 06:26:52 PM »
In most RLs the characters and monsters just have a position. Are there any games where the orientation of the torso and head are simulated in a gameplay-relevant way? I can't come up with a decent control scheme for the player character but imagine it could add some depth to movement and combat. Any ideas or suggestions?

3
Programming / Grid-Based Lighting
« on: July 18, 2012, 05:04:35 PM »
I'm trying to figure out a clever way to simulate light-propagation, shadowing and LOS on square grids.

As long as I only care for a boolean result (e.g. is whether a field is visible from another field) it's straight forward calculate using raycasting.
I just use the Bresenham Line Algorithm to trace the fields from start to max-range. All clear fields covered by the line are lit. as soon as an occluding field is hit I abort the raycast. Doing this for all the fields on the edge of the field-of-view I can easily find all visible/lighted fields.

This basic version that is working flawlessly but what if I need more specific information on how visible a field is? If you consider a blocked field casting a shadow a lot of fields are neither fully lit nore fully in shadow but "cut in half". Imagine tracing a line but with anitaliasing - there will be many shades of gray. So I'd like my "visible" property be a percentage (0 - 100%) and not just a boolean (true or false).

How would you solve this problem?

To make it even more complicated: What if the light-source has a non-integer position e.g. it's not right in the center of a field but in the upper right corner. This should affect line-of-sight and light-probagation calculations but isn't handled by the algoirthm I described above.

Sorry, that the question is not specifically rogue-like related but as rogulikes tend to feature very complex grid-based simulations I figured some of you guys might have solved my problem allready! All kind of feedback/opinion is appreciated. :)

Pages: [1]