2013-10-20

Dragontorc MS4

Although few things I'd like to change, I decided to close MS4.

In this milestone I created new rendering system (using SDL surfaces), room interior generation (more on that later) and simple travel system.

All graphics is temporary - programmer's art. And looks awful :)


As I decided to switch to C++, it may take some time until I convert everything to C++. And I have no idea how long this will take. And...

I'd like to try something else for some short time, experiment a little bit with procedural generation. I am not that happy with what I have now for room generation and as I'd like to make it proper and to use procedural generation for much more things, I will try something else (to not fall into same mistakes) and I will be updating here to show results.

2013-10-15

Weekly update MS04x35

I couldn't do too much during last week (weekend was "lost") but I still did few things that I am really happy about. Of course those were related to porting to c++ as I was sucked in by creating basic systems to be able to port whole code to c++. But boy, it was fun!

I have arrays and lists. I have some concurrency mechanisms, own thread management (threads without affinity masks set up), own immediate job queue system - I have immediate jobs queue and I want to add async job queue and a helper class that will support multiple queues with priorities. I'd like to make it work on as many cores as possible with basic separation into:
  • main thread (responsible for adding tasks for other threads, that will also do single threaded immediate jobs and all other immediate jobs)
  • rendering thread (will only do rendering and maybe some immediate jobs and/or background loading)
  • background tasks thread (will do background tasks and will load things in background, and do immediate jobs if nothing else to do)
  • immediate jobs threads
With such approach, I will have one thread doing rendering. One thread for single threaded immediate jobs (all physical activity that can't happen at the same time as other systems). One thread reserved for background tasks (it shouldn't happen very often and loading should go there, but on more cores I could have more background task threads and separate background loading thread(s)) and all other threads for immediate jobs (AI/logic, animation system, particles). And I want to pack everything together, so at any time there won't be any idle thread. I need to come up with list of jobs (basing on what I wrote above) and priorities for all threads.

And of course I want to make it possible to run on single thread too, as it will be easier to debug stuff and some computers may have just one core.

When creating code in vala I was already thinking about parallelization and I made clear separations in as many places as possible. With vala I could still do same things but it would be slower (in execution), it would be much harder to debug and I would have to add mechanisms that vala doesn't support by default and would introduce some mess into the code (there's no easy way to do pooled objects, not as easy as in c++).

For now I would still like to do missing bits (async job queue, job execution class) but I am switching back to vala to add things that are missing for this milestone.

2013-10-08

Weekly update MS04x34

The plan was to finish MS04 and then start porting to C++ but on the weekend with few hours to spare I started to implement some stuff (and reuse those that I've already written few years ago) that I will need for C++ version. Then of course I will spent at least few weeks to port everything. But you have to believe me how much difference there is between writing code in notepad++ and in Visual Studio. And to debug it. And now I even have stuff to detect memory leaks which should be handy to keep an eye on what's going on in the code. I could spend lots of money to have proper Visual Studio (not Express Edition) and Visual Assist X but now I can live without them. Although I tend to try to open file with alt+shift+O, go to definition with alt+G and try to do few other things that are so obvious and natural to me now. When I think of writing code, compiling at command line and wait for it to compile few minutes... No. And of course with some fundamental changes in C++ I may wait a lot too, but just minor changes should be quick.

I still want to do few things (implement pool, list, xml loading) and that should be enough for now and I'll get back to Dragontorc - now, with my recent hook I renamed it, but as I am still not sure about new name, I will keep on calling this game Dragontorc - have no worries, there is still wizard, servant, items and magic.