Topic: Visibility code and garbage collection
Last week I was doing the visibility code, such that the server will send only what it needs to and players won't know about anything else. It seems to work, so I'll find out when I begin to seriously use it. One problem with the code as I did it was that creatures can see each other, but the creatures being seen may very well be able to see the ones that are seeing.
That gives us circular references. Not fun. Reference counting won't work, but I didn't want to use ordinary pointers since that'd complicate everything. So, I switched all of the game's memory management over to garbage collection. I rolled my own since I thought it'd be fun, and what a pain it was. However, now the game's working fine with that, except the client crashes on exit. All that's left to do is to debug and integrate Squirrel's garbage collector with my own. That'll let scripts safely keep references to objects, and objects to script objects, etc. Pathfinding doesn't get along with the new visibility system yet, so that's another bit of work.
However, *after those* (the above issues are minor), here's what we've got, in (roughly) the order I think I'll implement them.
* Sight radii for creatures
It remains to be seen if the visibility system can be made efficient enough that monsters won't have to cheat. While it's clean, speed, well...
Anyway, if I give a creature a sight radius, and attach a client relay to it as a viewer, the client will be able to see everything the creature sees. This is so we can do pets *right* and perhaps play RTS style.
* Serialization within the map for more complex objects
There's no technical reason I can't serialize any object within the map, but I want to keep it limited to those it makes sense for.
Monster spawners come to mind.
* Monster AI
As I mentioned before, creatures already have 'goals', but those are only actions for an AI to use. We still need general behavior.
I'm going to try for 100% scripted.
* Chat channels
While chat is operational, I don't have any default channels decided on. Keep broadcast? Yell? What. I'd like your opinions.
* An understanding of 'maps' on the client
Presently the client has no clue what a map is. This is fine for now, but if we're going to be watching pets on multiple maps at once, the client'll have to know not to show map 2 tiles when we've got a map 1 creature highlighted, even if it knows about the tiles.
* Mouse-based map scrolling (like Starcraft)
Only for RTS mode, but once all of the above are done... For GMs I'll have it attach a viewer to the camera, so that we can watch over anywhere on any map at any time.
* Completely rewritten pathfinding
The pathfinding code is an impenetrable mess. Now that I have proper restrictions in place, it should be easier to write cleanly, and will probably take about an evening. The current code tries to do too much, and does it badly. Along with this I'll introduce stairs, since we need them.
Everyone's named Test right now.
Suggestions, comments, etc. are welcome. Pretty soon I'll need to be thinking about stat systems, game mechanics and what have you. That's the part I actually enjoy, so this'll be picking up speed.