So the A* pathfinding is finally up and running. Not perfect tho'
Some cases still mess the algorithm up. Specificly, when no path can be found, the algorith takesthe unit around the playfield is search for the path. And sometimes when the algorithm tries tomake a smoother path, it can drive over a corner of a structure..
Still, it feels great to finally get at least something done and for now I might focus my energy on other issues, insted of polishing the pathfinding.
Tuesday, March 18, 2008
Friday, February 29, 2008
Status report and a video
I've been working hard trying to get the AStart (A*) pathfinding algorithm working as effectively as possible, but it's still not done yet.
Meanwhile, I've prepared for you a small video of the select box in action, just to show that there has been some progress in the past weeks.
Meanwhile, I've prepared for you a small video of the select box in action, just to show that there has been some progress in the past weeks.
Thursday, February 07, 2008
The video as promised
Basic unit management
I've added an unit class structure similiar to the structure classes. It is now possible to add units to the field, select them for their information and give them a move order.
Moving keeps track of the facing of the unit and rotatets it as necessary. Well, actually the sprite is not rotated, but there are 32 different images of the same unit facing different directions. As the units move, thay push back the fog-of-war.
I'm going to make the units find paths using A* pathfinding, but for now the unit just goes x++, y++ until it reaches it's target. I recorded a video clip of the unit movement in action, but YouTube seems to be working slowly right now, so I'll just post the video once it get's processed.
Moving keeps track of the facing of the unit and rotatets it as necessary. Well, actually the sprite is not rotated, but there are 32 different images of the same unit facing different directions. As the units move, thay push back the fog-of-war.
I'm going to make the units find paths using A* pathfinding, but for now the unit just goes x++, y++ until it reaches it's target. I recorded a video clip of the unit movement in action, but YouTube seems to be working slowly right now, so I'll just post the video once it get's processed.
Monday, February 04, 2008
A little video
Hi folks!
I've uploaded a quick video of the fog-of-war in action. Sorry for the quality, DivX wouldn't accept the file, so I compressed it with Windows Media 9...
I've uploaded a quick video of the fog-of-war in action. Sorry for the quality, DivX wouldn't accept the file, so I compressed it with Windows Media 9...
Friday, February 01, 2008
Testing an early implementation of fog-of-war
This is an early implementation and might not be very efficent.
The idea is, that we have an array of integers that represents the maptiles and an array of integers that represents the tiles we are able to see. Then when we draw the tiles, we just check if it is visible or not.
Here's a picture with a vision radius of 5 tiles.

And here's another with vision radius set to 10 tiles.

Calculationg wether or not a point is within the visibility range is simple. The idea is from Java forums, but I trust most people can figure this out without any help.
Here's the formula:
if (Math.Pow((x1 - x), 2) + Math.Pow((y1 -y), 2) < Math.Pow(10, 2)) {
fogOfWar[x, y] = 1; //As in visible
}
the x1 and y1 are the coordinates of the center of the structure. The 10 in the end is the range of visibily, aka. the radius of the circle. And x and y are the coordinates of the point whichs visibility we are currently trying to determine.
The idea is, that we have an array of integers that represents the maptiles and an array of integers that represents the tiles we are able to see. Then when we draw the tiles, we just check if it is visible or not.
Here's a picture with a vision radius of 5 tiles.

And here's another with vision radius set to 10 tiles.

Calculationg wether or not a point is within the visibility range is simple. The idea is from Java forums, but I trust most people can figure this out without any help.
Here's the formula:
if (Math.Pow((x1 - x), 2) + Math.Pow((y1 -y), 2) < Math.Pow(10, 2)) {
fogOfWar[x, y] = 1; //As in visible
}
the x1 and y1 are the coordinates of the center of the structure. The 10 in the end is the range of visibily, aka. the radius of the circle. And x and y are the coordinates of the point whichs visibility we are currently trying to determine.
Just a minor fix...
New user interface
I've been working on a new user interface, sice the last one was really not that good.
It takes a lot of influence from Company of Heroes and C&C Generals. Here's a picture with no unit/structure selected:

And here's another one with a structure selected. The build-buttons -class renders all the available build options on the free slots on the interface. The build-buttons -class works together with the gameMouse -class to test if the button in beeing hovered.

I'm much more pleased with this new interface than with the old one, but making these cosmetic changes is newer a wise thing to do when theres still a whole lot of the game engine missing...
It takes a lot of influence from Company of Heroes and C&C Generals. Here's a picture with no unit/structure selected:

And here's another one with a structure selected. The build-buttons -class renders all the available build options on the free slots on the interface. The build-buttons -class works together with the gameMouse -class to test if the button in beeing hovered.

I'm much more pleased with this new interface than with the old one, but making these cosmetic changes is newer a wise thing to do when theres still a whole lot of the game engine missing...
Thursday, January 31, 2008
Returning from long holidays
It's been a while since anythings gotten updated on the rts project. Finishing my bachelor of science thesis has taken all my free time and then some, but now I'm ready to post a quick update.

Don't let the black borders fool you, I'm just using a bigger screen resolution than the map is. Here you can see some small changes:

Don't let the black borders fool you, I'm just using a bigger screen resolution than the map is. Here you can see some small changes:
- Tooltipp hints are now of the right length instead of the old fixed width boxes
- structure health has a visual aide, green-yellow-red healthbar colors
- mouse is now handled mostly in it's own class - which also supports cursor animations
Subscribe to:
Posts (Atom)
