Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 04 Jan 2011
Offline Last Active Dec 15 2012 10:01 AM

Posts I've Made

In Topic: Camera, Player, and GameObject Architecture

04 December 2012 - 02:04 PM

Hey Neglected,
Thanks for your reply, the component method seems to be working very well for me!

Good insight, mate.

In Topic: Camera, Player, and GameObject Architecture

02 December 2012 - 03:33 PM

Fabulous! This is my current approach. It seems sustainable. Is it common?
Much appreciated.

In Topic: Line of sight / Fog of war in RTS

15 February 2011 - 05:35 AM

You could pre-calculate the LOS for each tile using the max LOS distance for any unit. This could increase the loading time of your level "dramatically" depending on the size, but may be worth it. Then, just lookup the list of tiles which can be seen for each unit according to the tile it's standing on.

As long as you don't build LOS blocking walls during the game, you should be fine; although, even this can be handled efficiently given you have already computed the lookup table.

Hope this helps.

In Topic: Fluid Motion in RTS unit

09 February 2011 - 06:29 AM

Hi, I've been experimenting with C# and XNA, trying to see if I can make a 2D RTS.
After designing a basic class, I've gotten stuck on a design issue.

I want the basic user controllable unit to consist of smaller elements (i.e. player controls platoon, which consists of soldiers).

But how does one create a fluid, random motion of soldiers within the unit formation?

All I can think of so far:

When ordered to move, the relative position (at the destination) of each soldier in the unit is randomly changed by a small amount.

The troops have a somewhat randomly varying speed as they move. (terrain speed-modifiers would also affect this)

I would need to use a basic unit collision detection, not sure where to begin with that,

Any ideas, comments, implementation tips would be greatly appreciated.
This more of an excuse for me to expand on my programming experience, but getting something like this to work would be amazing for me!

Well, you need to decide a few things before proceeding.

Do you want the units (of the platoons) to move individually? Or should they move as a block, like a legion of phalanx?

In the first case, like Strarcraft did, you could, for the group you have selected, set the same target point for each unit in the group. So each unit would try it's best to get to that point. This caused units to keep moving even after the majority of the group stopped in Starcraft. As far as determining how each unit attempts to come to that location, you need to look up path-finding and find suitable algorithm for your terrain/map representation.

In the second case, you can handle the entire group as a single movable unit, but have individual animations for each unit. Each unit's animations could be oriented toward the target point, while the group gradually moved as a coherent block toward that point. This would, for example, result in all of the individual units facing inward if the block of units was centered directly over the target point.

As for collision detection, simple 2d detection schemes are bounding box, and bounding circles. Information easily found by googling "2d collision detection".

Hope that helps.

In Topic: [WPF] Accesing text ranges in Document

03 February 2011 - 03:51 AM

The only thing I could think of was you are somehow messing with your position pointer in your paragraph..

Try this:
TextPointer ptStart = prg.ContentStart.GetPositionAtOffset(match.Index, LogicalDirection.Forward);
TextPointer ptEnd = prg.ContentStart.GetPositionAtOffset(match.Index + match.Length, LogicalDirection.Backward);

Hope that helps.