Archive

Archive for November, 2013

Web Stuff and RTS Project Status

November 30th, 2013 No comments

Well, it’s been a week and I’m still working on a website, 1 to 2 hours a day with another few spent on researching the DirectX 11 API in depth as most of my rendering experience is behind with DirectX 9. Having read through large text resources, it’s given me some great insight on future systems I intend to write, which means I can start posting more work samples rather than theory and more importantly, content that is of more interest to the public.

In regards to the RTS project I have currently put it on hold due to the fact I’m working on the website, and my main interest has been focused on writing a complete game engine which will take a considerable amount of time as well the constant reminder to seek employment which is becoming tiresome. On top of all that I’ve had various issues with the pathfinding due to unexplained behaviour with Unity’s inbuilt navmesh agent after it is interrupted with my local A* solution for collision avoidance which isn’t something I can fix unless I opt to purchase an expensive third party navmesh plugin or spend a long time writing my own which is out of the scope of the project.

The main purpose of the RTS design was to see if I could replicate core functions from the genre – fog of war, an interactive interface, unit control, pathfinding, building placement and construction, individual AI (such as the harvester automatically collecting resources)  and some other tidbits. What I might do in the future is see if I can expand on it and polish it up, after all the last missing component is the actual combat.

With that said, I have not yet discussed my implementation of the Fog of War system, so this will be an update I will release in a short time that details how it works, with some screenshots to keep things interesting. The next image posted thereafter are most likely UML diagrams as I plan the architecture of my realtime rendering engine. However, expect interesting image results too as I’ll be experimenting with the latest shader model languages!

Categories: Me Tags: , , ,

Web Development

November 21st, 2013 No comments

It’s been a little while since the last update, mainly for two separate reasons. The first being I have had second degree burns on my shoulder for a week which wasn’t helping motivation to code let alone use a computer or do anything else, and while I didn’t do nothing I chose to take a bit of time off from any side hobbies until I could get to a point they’d be fun to code again.

The second part goes for a website I’ve been creating for someone that’s essentially going to be used for a small community group, and since this is a bit more than a hobby project I’ve been prioritizing it’s completion has a somewhat larger meaning. The thing is I’ve never actually dealt much with web development. I have a blog which I occasionally tinker with, and I have had some work done with SQL databases for non-web based applications. The nice thing the deadline is very relaxed; essentially ‘get it done before the end of the year or something’ so it’s given me ample time to explore some features. I’ve been using jQuery, the Facebook API, the Google Maps v3 API, more PHP and a fair bit of CSS.

I’m quite content with the progress I’m making, having developed a user system that synchronizes loosely with the Facebook API (only for notifications, which work nicely) as well as varying levels of access, and of course, secure, salted and encrypted passwords. There’s a bit more to go – I’d estimate I’m just over the halfway point now with a fair bit of that second-half simply being polishing things up, and I might post a link up once I’ve finished it. I’ll post a bit more later on how I’m dividing up my workload so if anyone follows the posts then you’d have a better understanding of when to expect things.

Categories: Me, Programming Tags: , , , ,

Pathfinding

November 6th, 2013 No comments

The next topic is path finding. It’s a tricky subject with an RTS as I’ve found, as ultimately it’s the most complex system each individual unit must perform, therefore it is directly affecting how many RTS units the game can have at a time. The faster the algorithm, the higher the theoretical unit count on the same system. I’m pretty lenient here with my unit count since I’m not asking for a huge Planetary Annihilation /  Supreme Commander style RTS, neither am I asking for the precision systems of the Men of War series. I’m going to go with a target count of 100, so I’ should have plenty of CPU utilization room for pathfinding, assuming of course I don’t create a horrible algorithm.

Technical talk aside, I’ve recorded two videos that demonstrate two different versions of pathfinding. Both use Unity’s inbuilt nav-mesh to an extent, which from what I’ve read is a very fast pathfinding system. It didn’t take me long to figure out why, considering there is absolutely no collision avoidance built in which makes it a little less useful. The actual pathfinding itself however is good, and the agent system isn’t bad. The videos will be from a week old built, but it was a good time to record them as I was phasing out the old temporary system.

The only thing I didn’t like about the nav agents is the fact they rotate and move on the spot, giving a very weird sliding behaviour if your agent is meant to be a vehicle, so I’ve designed vehicle units to stop and rotate to a 15 degree zone of their target direction giving it a more natural approach.

Of course, the more important aspect was collision avoidance. RTS buildings can be placed at any time, in addition there’s lots of potential units all moving in different directions. My initial approach was to create a simply temporary system that paths around objects using cross products. This worked alright for pathing around single objects, but with multiple objects, the generated pathing started to become undesirable. I would simply set a temporary destination 90 degrees off a cross product from the unit position and the obstacle position.

The second method, a little less temporary was to implement an A* grid, and use this on top of the nav mesh. The avoidance path is currently not pathed all the way to the destination, meaning that after one obstacle a unit may have to figure a way past another in the distance. It makes sense to a degree as the pathing a long distance may be very processor intensive and may be wasteful considering obstacles can appear, disappear as well as move around.

At the moment the pathfinding works quite well with the avoidance system actually being more complete than the rest. The immediate change I can think of is sending a group move order without the units trying to pass around each other at the destination – setting a group destination pattern based on the relative position of other group units. At the moment, ordering a dozer to construct a building will set the destination to one of the four sides of the building – whichever is closest, after which construction begins.

There’s been quite a few nice additions since the videos, a big one being fog of war which will be fun to talk about, as well as a refinery/harvester/gold combination, of course relying heavily on the pathfinding. Another one being buildings now require a bulldozer to built them!

Categories: Me, Programming Tags: , , , , ,