Hot answers tagged

24

You don't want to sync the positions of all the units from the server to each client; that will take up way more bandwidth than you need. You'd also have to deal with interpolating/extrapolating unit positions, etc. Almost no professional RTS's use client/server! Instead, you want to send only the players' commands. Rather than moving the units ...


24

Personally, I find symmetry in level design to be boring, and I don't think it's necessarily the case that it's needed for fair levels; symmetry is a way of ensuring that everybody has access to the same resources and the same bottlenecks by virtue of the level literally being mirrored for each player in some fashion. I think the important part is access to (...


22

A common approach is to have a component-based approach where the base-class "Unit" just implements the most basic aspects all units have in common, while each unit then has a list of multiple component-objects which say what it can do and how it does it. For example, a tank might have the components Mobile, Destructible, Attacker, an immobile turret only ...


18

Assets like these can be created in any 3D package. They are imported into a game by pre-rendering the models at specified angles, using orthographic projection in the viewport. The pixel effect probably is a side-effect of rendering at a low resolution with little or no anti-aliasing. The spritesheets generated by these will be ordered in such a way that ...


16

It's common for the client to implement some sort of feedback to let the player know immediately that their chosen action has been registered, eg.: interface sound (eg. button click) in-world sound (eg. a character saying, "At once, commander") animation (eg. begin swinging a sword) These can take place while the information is travelling to the server ...


13

I've made a TCP-networked RTS, in which I passed the commands themselves, rather than the results of the commands. For instance, a player gives a move order. If the move order is valid according to that client, it is sent to the server. The server then sends it back to all clients, who validate and execute it. So all client machines run the game ...


13

There is no reason to communicate over the network when the player selects units, because in most games just selecting a unit has no game-mechanical consequences. So this is an information which isn't relevant to the server or to the other players. But what would be important is when the player gives a command to one or more units. When issuing a move-...


12

I worked on Roller Coaster Tycoon 3, and I think it's a good game! In fact bar that extra dimension that gives you the ability to ride your amazing roller coaster creations, it's pretty similar to RCT2. When developing, we lifted as many decisions as possible from the RCT2 codebase, because why re-invent the wheel, right? Maybe you just miss the easier-to-...


12

Rule number one of multithreading: Don't even think about it, unless you really need to use multiple CPU cores for performance reasons*. Multithreading opens up a whole can of worms of obscure and impossible to reproduce bugs: Race conditions! Because you have no control over the thread scheduling of the OS, you have no control over the order in which ...


11

You should add more information about how you are implementing the game, but here are a few sugestions: Keep a bitmap of the whole map, each time a new area is explored just flip the corresponding bits as they become visible. You can do the same for the revealed area. Enemy units are drawn only if they are in the revealed area. You'll need to keep a 'last ...


11

There is actually a pretty nice article about this over at Gamasutra. And covers topics like formations and resolving collisions: And another article from them on the same topic, which is a bit shorter but has more pseudo code examples: Finally, a nifty thing to think about when implementing your system is the idea of a "Flow Field" Supreme Commander 2 ...


11

Glenn in his article and comments gives a very strong case for using UDP over TCP, but SC2 obviously uses TCP. Glenn mostly talks about physics-driven games, ie. first person shooters and driving games. These have different requirements to real time strategy games where precise unit positions at every logic step are important. So the communications ...


10

Look into bounding volume hierarchies (BVH). They're most commonly used in collision detection to reduce the number of checks needed when calculating collisions or in rendering to perform frustum culling on objects. Since you're already using spheres, I'd suggest a sphere-tree though other volumes such as AABBs may be more efficient. I'm not sure what sort ...


10

Yes, navigation meshes are still applicable to tile based games. Although, they would primarily be used as a optimization. For example, I've converted the lower left of your image to use a navigation mesh: In this case, each green square would be a navigation node. As you can see, this drastically reduces the number of nodes that A* needs to process. ...


9

Spring RTS engine looks very nice. Stratagus is another option. Both the above came from the search 'c++ RTS engine'.


9

I agree with Petr: There is no set way to do it. How you want to do it is a matter of how you want to design your game. In this circumstance, however, I think it's immediately obvious the sort of mechanic you're trying to get at: you just want things to produce as fast as possible, within the amount of mass you have available. Producing within capacity I'...


9

You can add a simple attribute to each tile that specifies its level. So for example: tileA.layer = 0 // Will be at the bottom tileB.layer = 1 // Will be above level 0, on top of it. // Add tiles to layered list List<List<Tile>> tiles = new List<List<Tile>>(); tiles[0].add(tileA); tiles[1].add(tileB); // Draw 'em in the right ...


9

Create a grid with enough spaces for all the units you want to "unclutter", have them each choose the nearest unclaimed grid space. Then have them move towards their respective grid space. This will move them into something like a formation, where the player can easily select an individual unit. That's an O(N) operation with pretty good results.


9

Break movement into two steps Select a position on a 2D X/Z plane located at the entity's current Y position. Set the offset (up or down) from that plane. This is similar to how Homeworld, one of the first 3D space RTS games handled movement. Works really well. Breaking movement into two steps provides the most control, simply because the mouse is a 2D ...


8

Personally, I would recommend Unity. In comparison to Torque I've been able to get basic proofs-of-concepts running far faster than before. (Of course, there is a bit of bias as I was far younger when experimenting with Torque) But in general, it's been a far more pleasing experience to work with. Also in comparison to what I remember from the community at ...


8

Yes, there is. It's called Robocode, and you basically program your own bot in Java, and fight with other people. You can battle against other AI bots, or play multiplayer over the Internet. Here's the link to their homepage: http://robocode.sourceforge.net/.


8

Ok, currently there's 4 major options for browser based games. Java - Revived mostly due to Minecraft and Android, Java requires a plugin with about 75% market penetration (source). It's also a fairly complicated language that really isn't suited for first time programmers. There's advantages to using it, but it's probably not the best option. Unity - ...


8

You could read some Gamasutra features. That's usually a good source of information, from people that actually ship games: The Design of StarCraft II StarCraft II: Building On The Beta 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond Successful Playtesting In Swords & Soldiers Postmortem: Ronimo Games' Swords & Soldiers The ...


8

KD-trees are definitively not dynamic enough to be considered, honestly. Moving a few units can easily require you to rebuilding of the whole KD-Tree. A KD-tree is very efficient for queries, but not much for neighbor searching. A quadtree is more flexible over time, as the location are more local. The disavantage is that if you have a lot of unit at one ...


7

I suspect part of it is that low-fidelity graphics engages your brain more than high-fidelity graphics. Your brain works harder to fill in the blanks, you become less a passive consumer and more a co-creator of the experience. It's like the difference between reading a book and watching a movie. Scott Cloud in Understanding Comics talks about how generic/...


7

Balance (usually symmetry) so that you don't get an unfair advantage by a random spawn point Allied to this is having a big enough map with enough different start points so that there is an element of FUD at the beginning of the game: 'Where is he?', and the chance to use different strategies such as redeploying bases. It is fine to have a couple of ...


7

Glest, especially MegaGlest and the Glest Advanced Engine (forums) Its a classic RTS engine that is fairly straightforward to 'mod' and add 'factions' using 3D models and XML files to define the unit attributes. It can be used as a basis for 'total conversions' and the code-base is accessible enough to add specific features. It may be that you don't ...


7

There is no need to implement BVH's, since Unity's collision engine essentially does that for you already. Simply attach a large bounding-sphere trigger to each unit (representing its range) and handle the OnCollisionEnter() and OnCollisionExit() callbacks to keep track of which enemies are within range of each unit. Note that the case you're interested in ...


7

A google search for "rts engine schematics" turns up a few relevant hits. ORTS: http://skatgame.net/mburo/orts/orts.html doxygen documentation for that over here: http://skatgame.net/mburo/orts/doxygen/html/ Stratagus: http://stratagus.sourceforge.net/ http://stratagus.sourceforge.net/download.shtml These might not necessarily be the best examples ...



Only top voted, non community-wiki answers of a minimum length are eligible