70

Melee counter-attack is an easy way to make ranged attacks valuable. Do you build and use units that have strong melee attacks but die more easily because they're in melee or do you use units with weaker ranged attacks that live longer because they can stay out of melee? Melee counter-attack reduces otherwise over-whelming attacker advantage. In a game ...


16

Collision resolution, instead of collision prevention. Simply move the objects, then check if there have been any collisions. If there has been a collision with another block move back to previous square, or depending on the game type, a different square.


15

It's a basic question of a certain type of "realism". It's hard to imagine getting a melee hit in on an enemy and them not getting involved at all, because you have to very close to them to hit with with something like an axe. It makes sense that the unit getting attacked gets a swing in. Ranged attackers can't get hit by the melee units they attack because ...


15

I am currently developing a turn-based strategy game. There are (overly simplified) two kinds of units in the game: sturdy melee damage sponges and fragile ranged damage dealers. The player is supposed to position the first in a way which prevents the opponent from attacking the second. However, that usually means that the melee units will receive the first ...


11

Flag all players as either stationary or moving, depending if they submitted a move this turn. Go through the list of moves. If two moves point to the same location, remove them from the list and set the players stationary. Loop through the list removing all moves that point to a stationary player or other obstacle. Do this repeatedly until the list doesn'...


11

You will probably need to micro-manage the 3G modem to ensure that you don't have delays while it switches power modes. Your simple answer is make sure you send at least one packet larger than 128 bytes every 6-8 seconds. If you can guarantee that all your packets are smaller than 128 bytes make sure you send something once every 6-8 seconds. Avoid, at all ...


11

You can either copy an existing battle system, or create a new one. Copy. This is obvious, use Google to find information about some RPG mechanics (e.g. AD&D or Fallout) or play your favorite game and this will be inspiring enough. Problem with this solution is the fact that better systems are more popular and players are more bored with them. Create. ...


11

I agree with Jari Komppa that defining card effects with a powerful scripting language is the way to go. But I believe that the key to maximum flexibility is scriptable event-handling. In order to allow cards to interact with later game events, you could add a scripting API to add "script hooks" to certain events, like the beginnings and endings of game ...


10

I'm not sure what it is exactly that you want to achieve. But, there's one pattern that is used constantly in game servers, and may help you. Use message queues. To be more specific: when clients send messages to server, do not process them immediately. Rather, parse them and put into a queue for this specific client. Then, in some main loop (maybe even on ...


9

I gave this problem - flexible computerized card game engine - some thought some time ago. First off, a complex card game like Chez Geek or Fluxx (and, I believe, Dominion) would require cards to be scriptable. Basically each card would come with its own bunch of scripts that may change the state of the game in various ways. This would let you give the ...


8

Pacing One standard rule not just of game design but of any form of entertainment is to aim for an engagement curve which slowly builds up excitement and then relieves the tension at the peak point. Game designers usually aim for that curve not just in their overall narrative, but also in smaller events, down to the most basic game loops. When you ...


6

If you need an active connection and literally real-time gameplay, then go with WebSockets, or a similar technique like Comet. Note that WebSockets requires a recent browser, while Comet is probably good enough for most purposes with better support for older browsers. For example, Facebook and Google use Comet for their technologies (Facebook Chat, Google ...


6

i don't know about Risk but i had developed a Chinese Chess game few years ago. I think you can try Minimax which the game calculate every possible decisions and each decision will branch out a node for all the players until a certain depths within reasonable time. I think it is suitable for most turn based games. For 'difficulty' your game will randomized ...


6

Go is difficult for computers because there are many, many possible moves for the player in each board state, too many for the computer to brute-force and calculate all possible outcomes (unlike, for example, tic-tac-toe). Traditionally, chess playing computer programs would calculate all possible moves a few turns into the future and pick one of the moves ...


6

Of course it's good for you to have this tree, but what I see from this is that you are aiming too high! As a beginner developer you might just get stuck. Trust me it happened to me many times and I have only finished one small game. I didn't read the whole thing, but I ran trough it and I can really say it's too much for a beginner. So if you want to get ...


5

I wouldn't do the turn-based gameplay in a separate loop. Instead, just have the one main game loop like any other game, and that loop checks if it's time to advance a turn yet.


4

The idea of simultanous turn based gaming is quite old, actually. In industrial age around 1800, it has surfaced as Kriegsspiel - german for wargame - and was used to train officers in the Prussian army. Also, the concept is well known in the board game community, with early game system titles like Diplomacy beeing released in 1959. As for computerized ...


4

Move all players according to their request. while there are still some squares multiply occupied: For each square that is now multiply occupied: For each player in that square that moved there this turn: Return them to their previous square Mark them as having not moved this turn This requires that each player remembers ...


4

Ok, if you don't care about the graphics, that's simpler. From a high-level pseudocode, what I suggest is like how any other game loop works: while game has not ended yet: keep going // we're out of the while loop; game has ended show results, etc. go back to main menu Thing is, yours is turn-based, so we can do away with the loop part, or keep it and ...


4

For a game like you described you might consider going for a full Planner based solution. This allows you to describe simple transformations of the world state the AI can perform. Essentially the AI plans a number of moves ahead of time to reach its desired goal. This approach is computationally expensive but for a turn based game it's a great fit over ...


4

This is primarily just a design decision. Consider that you can actually do these things at the same time. If you look at the situation in terms of your update loop: Update 1: Calculate outcome for entity: n Play animation: n (frame 1) Update 2: Calculate outcome for entity: n+1 Play animation: n (frame 2) and n+1 (frame 1) Update 3: ...


4

Here is how I would approach this: I would start by performing terrain analysis (pdf) and creating a set of influence maps based on various attributes (conflict maps, resource maps, etc). You might want to combine the influence maps together with associated weights. You'll probably update some of them at the start of each turn. But assuming you have the ...


4

When you develop your game object-oriented, this might be a good application for the flyweight pattern. In this context, a flyweight would be an object which acts as a copy of the gamestate, but actually references the original gamestate it was created from while also having one or more modifications to it. To create a flyweight, you need a reference to ...


4

Your pathfinding should return a list of way points to reach your objective for each unit. Since you are making a turn based game, I am assuming that the unit movement is like a chess piece. It is either on "this" tile or "that tile, and not in between. If this is the case you might end up with the scenario where a units movements runs out in the middle of ...


4

The server has to have a copy of the game state. If you can reasonably expect that the game server will be up and running during a particular game, and that all interaction between players in that game will always occur with that particular game server instance, you can simply hold the state in memory. If, on the other hand, you expect a server to only be ...


4

Note: I'm playing fast and loose with the pseudocode here, so let me know if anything is unclear. Ideally, the player shouldn't be special - just another set of components. The main function of entities is to group components. You might think of it this way: components get updates, not entities. From the good old Evolve Your Hierarchy article: Updates ...


4

I think the rationale is pretty simple. A melee or a close quarters attack is a immediate threat to your survival fail to counter and your dead, or running for your life. Going into a melee is a two way street, you might get the first blow, but the other will counter attack or die. Nobody in their sane minds would be standing in place when they get attacked....


4

You add additional depth by mixing 2 existing systems. System 1: Combat can be initiated from either side, winner is determined by stats and luck. System 2: Only the one initiating combat deals damage. Retaliations are just a variation of the first system. Both systems make sense on their own. "Attacker deals all the damage" has been used since chess, so ...


4

You should not force players to make their moves under duress by giving them a ticking down countdown timer. A reasonable time limit might not be a bad idea to prevent AFK players from ruining everyone's game experience, but if you make the time limit too short, the game will become very stressful. You don't want players to lose a game because they simply ...


4

First of all, 65000 peak current users is quite a lot. Many games don't even get near that number. Looking at the current player stats on Steam, there are just 7 games which broke that limit today. And if you think you are playing in the same league as CS:GO, DOTA 2 or PUBG, then you should be able to afford more than one gameserver. But the number of ...


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