Thursday, 24 April 2008

Sigh,
Its been slow going...
I have some basic images in the game now, Little Sheverons for the units, and an Illustrator house for the buildings. The units in the squad that is currently sellected changes colour to represent their health.
I've ran into a dilema. I want to have stacking behaviours. I have the code. It works. But its kinda pointless and making it far more complicated than it really should be. Having to code in the exact same stuff for each beheviour is not very good coding wise. Thus i think i'll take out behaviours as the are at the moment and start again. :( what i think i'll do is comment out all the code that is currently in all the behaviour classes and the unit and squad class and start again from scratch.
I'm thinking of each uni having 1 of each behaviour, but only having IDLE to start with. Then using some "Fuzzy Logic" to decide what behaviours to call etc. sigh should really be past here by now and on to the writing. I have 10/11 days to get my first draft done so I can show Euan. That shouldn't be too hard, but have maths as well. I think its tea time then i'll start on the raping of my current code and all that jazz.. :( woooo :D

Sunday, 13 April 2008

Fuzzy Logic

Right, well I added the menu options to allow the user to select the number of nodes in X and Y, which broke it because deviding 11 by a number gave an error in == as the numbers were not 100% identical due to loss of persision. A basic collision detiction test was used with the steps inbetween the nodes being *1.2f just to make up for the error.

Waypoints were indeed broken, but have now been fixed

multi-objects works now, it didn't, but it has been added and thus fixed :P


What i need to do now is figure out what behaviours a unit should have... sounds thought might have to be done.

Saturday, 12 April 2008

A* Finished

Wooo A* pathfinding has finished being implemented wooo
There is now two methods of using the A* pathfinding.
  1. Creating nodes of equal distance appart in a "grid" accross the screen, any impassable objects created will delete any nodes that are totaly obscured by the object and re-align the surrounding nodes to not point at it.
  2. Any new impassable object that is created will also create nodes on the corner of that object and will connect to other nodes in line of sight* and should reduce the cpu/memory overheads and allow more units on the screen
At each stage of the walk though the nodes, a check is made to see if the next node is in line of sight, if so the current node is missed out, then the next node is checked (althought i think this breaks waypoints :()

Still to do: Add in an option to the options menu to allow the user to change the number of nodes wide and high that will be used for Method 1. of A* this number will effect the speed and accuracy of the pathfinding :)
*oh btw, i would check to see if multi-objects work

Started doing the outline of the write-up, looking good, now just need to start filling it in. Between that and the AI essay

Next thing to do is implement fuzzy logic.

Sunday, 30 March 2008

Pathfinding Day v000.002

Sunday 30th March:
First things first. I am going to be using A* Pathfinding. But before generating the route using the A* algorithm, check to see if there is a direct "Line Of Sight" path between the starting position and the target position. This was implemented first by the use of c#'s Ray, BoundingBox and their .Intercetced methods... These all handle 3D calculations, which is good for 3D, but since this app is only in 2D it does not really make sense to use it... also it wasn't giving the correct results. The only (and best) answer was to write it myself, this was good because it teaches me how to do do thinks like RayBox intersection, and other line of sight algorithm... thing-ys.
A Unit class was created in order to controll the moving of the Units on the screen. This included ablity to select a "Target Position" where the Unit will move towards at a constant speed until it reaches that position.

Once this had been completed, a new sprite was added to act as a in game object that will block the units Line Of Site thus stopping the unit from moving (The Cursor will change to represent this error) ... And now it does heehee! It was during the creating of the line of sight and navigation around the in game "Obstruction" that the idea of including waypoints in the game would be a nice addition. Thus they were added. By clicking with the mouse the first "Unit" will move to the location as long as it is within Line Of Sight, if the user holds the [Shift] key while clicking, it will create waypoint and queue up the movments. Each new waypoint must be in Line Of Sight from the last created waypoint in order to be created. If the user clicks without holding [Shift] any waypoints will be destroyed and the "Unit" will move towards this new TargetPosition.

Proper Starting now...

Saturday 29th March... Looked up some tutorials, not that i've not been watching XNA videos and reading suff all the time, but found a nice state machine menu system from MS (http://creators.xna.com/Headlines/developmentaspx/archive/2007/01/01/Game-State-Management-Sample.aspx) which was very impressive... so much so that I decided to start again and use this as the basic framework for my project.
I then set about importing the work that was done previously. Since the layout of the code was so different it was decided that starting from scratch with the sprite class would be the right thing to do. The sprite class created included the ability to animate sprites from a tilesheet of images of any size and frame count, as well as controlling the frames per second of the animation.
Once the sprite was implemented it was time to call it a night.

Last Few Weeks

It has been a while since last update.
Done my progress report, even though it was pointless. Wrote a very good abstract for it before finding out that an abstract was not needed for the progress report... oh well lest I half have one for the final submission. I wonder if we will ever get feedback on the progress report... no, but i'll ask

Kinda realated on the 12th and 13th of March went down to Pourtsmouth and then up to Cambridge for interviews at Climax then Frontier respectivly. The Climax interview was going quite well even though it seamed especialy demmanding for a graduate position but was a bit stuck on a question and it went downhill quickly.
Fortunatly the Frontier interview went much better, so much so that i'm going back down on the Tuesday 1st of April wooo so fingers crossed, sounds like a good place to work :)

Monday 17th March, 07:31, Started coding again, this time in XNA wooo
07:48 finished coding for the day lol. Got a sprite moving about the screen using the mouse to set a way point.
Wooo Thats a start at least. Then had a meeting with my supervisor at 11:00. Said that I would have the intro and background reserch sections of the writeup done for the 10th April as well as having the majority of the programming completed.

Tuesday 25th Interview at Cohort Studios, Dundee. Went quite well I think. Just have to wait and see, Nail is having an interview on Thursday so it is unlikely i will get a response before then, and even then, Nail will probably get it since he has quite impressive demos... oh well.

Tuesday, 4 March 2008

Progress Meeting - 4th March

Had another progress meeting today. Because of the maths (and procrastinating) i've done no work appart from watch hours and hours of XNA programming vids. Still got lots to watch. So much to do. Really need to get my finger out :(

Progress report was supposed to be due for tomorrow, but has been moved back to Friday! woo

Planning on doing some work on it today... not going to happen! lol well maybe after the Sega thing thats at 3! Damn, has to be done today, cause tomorrow will only have a few hours in the morning, and will have to work on Thursday :( grrr oh well, better make a start :( boo! lol