Got a bunch done today.
Today I tweaked stuff, but then something horrible happened.
I found a bug.
A nasty, nasty bug.
I still don't know how to reproduce the bug, but every once in a while (takes at least ten minutes of random attacking to get one), an invincible enemy appears.
Odd.
But not that odd right, maybe they are just disconnecting from events or something?
If only it was just that, to make things even weirder, normal enemies jump over small bumps,
Invincible enemies do not.
/still-as-confused-as-I-was-this-morning.
I wrote some super hacky code to make the npcs able to enter a tent. How it works: the function that searches for the nearest item of a given type, when it encounters an item that leads to another screen (such as the tent) LIES to the ai and says that the tent IS the droids he is looking for - but that instead of calling the "get_item" function to get it, the npc ought to in fact call the "enter_item" function. Upon being whisked away to the tent screen, the npc realizes that he still does not have the item he is looking for and starts the search again.
Exiting the tent is similar but even simpler (and hackier). While searching for items, if the item can't be found but an exit can, we just pretend the exit is what he is looking for. When he walks over the exit, he will automatically be warped to the other screen by the exit code which has been in my engine for ages. Upon teleporting, his AI state resets (all map changes reset the ai state) so his real search can continue
This is pretty much cheating, but it's a particularly cool kind of cheating. It is in a way similar to how signal broadcasting works The Sims, where almost everything is encoded into the objects themselves without having to explicitly teach the SIM how to use different items. For example, I could use the same signaling I did for the tent to make npcs understand how to get an item out of a chest. Or what about animals who need to eat other animals to get meat? Just make the animal broadcast the signal "I'm meat but you have to use 'attack' instead of 'eat'.
(Note: there are some pathfinding issues going on here, try to ignore them lol.)
Added... this. Not quite floodfill.
How to fix: Trace upwards to find the first non-empty block and copy its X-Coordinate. Compare against that coordinate when generating new columns.
When to fix: Not today.
A very short update today. Mostly did a lot of planning and thought about what to do next. Came up with about 8 things than need to be done next and I'm hoping to do some coding tomorrow. :)
Yesterday's update can be found here.
In a case of any questions or suggestions, don't hesitate to contact me here or on twitter. ;)
For more updates, you should follow my twitter account - @PeterLauris and the account of Crystal Kingdom - @CrystalKingdom_.
So I made something today. A couple lines of code and a little test of the engine. I also decided to release the title now. CONTINUUM ENGINE will be both the title of the engine and the game. There isn't much to see, especially because the draw() method is broken for some reason. I'll have a look at it tomorrow possibly. And now, All your base are belong to us