Tag Info

Hot answers tagged

34

*Edit: Fixed error in javascript that caused error on firefox * Edit: just added ability to scale hexes to the PHP source code. Tiny 1/2 sized ones or 2x jumbo, it's all up to you :) I wasn't quite sure how to put this all into writing, but found it was easier to just write the code for a full live example. The page (link and source below) dynamically ...


23

What you do depends on the nature of the achievement. Unless your achievements all fit a simple pattern (collect X number of Ys), you're going to have to special-case them to some degree. Using a message-based communication system, you can provide hooks that makes the special-case coding localized. You can have certain actions fire messages to listeners who ...


16

From left field: Don't allow the player to give direct orders to his units The idea is that you give the player's troops the same AI capabilities as the enemy, and then provide him with a goal setting system and a state toggle system. The player can set goals/objectives attached to enemy units or map locations, such as: Destroy this Guard area Clear ...


11

You should write a small javascript tile layout engine that maps the database tile coordinates into a view on the web page, because this lets you outsource the cpu processing time to the players computer. It's not hard to do and you can do it in few pages of code. So essentially you'll be writing a thin layer of PHP of which only purpose is to deliver ...


11

Your goal of synchronizing 50 events per second in real-time sounds to me like it is not realistic. This is why the lock-step approach talked about in the 1500 archers article is, well, talked about! In one sentence: The only way to synchronize too many items in too short time over a too slow network is to NOT synchronize too many items in too short time ...


10

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 ...


8

I'd throw away the first two of your bullet points. It might be a good idea to get some units designed, but isn't going to really help you for balancing. Really what you're going to have to do is just play the game a lot and keep a analytical mind (or set of minds) looking at the problem at all times. Design is a very soft art, there is no iterative way ...


7

Don't allow it. Give the player a specific role, and that's it. The guy who gives the orders to attack a group of enemies to the north isn't sitting there at the fight telling each guy who to shoot, he's back at base giving more orders to other soldiers. For a more realistic/immersive experience, and to discourage/prevent micromanagement, allow the player ...


7

The first step is to have design goals. Figure out what kind of features your game will have, so you know where to focus your efforts and what designs to look out for. Will it be graph heavy? Will it be minimal and have panels upon panels hidden away? Will most of the action take place in the UI or in the game world? Will it be animated? Does it have a theme ...


6

Most games centre around a 'game step' loop. Things happen in discrete pacels of time. It is straightforward to have a queue of future events and to consume those events for each game step. More about game time-steps on the gafferongames blog.


6

In general AI in games shouldn't be thought of as 'complex' it is all about getting what you want with the least possible effort. The name of the game is Emergence. In this case, your fundamental conceptualization is wrong. These 4 systems do not need to work together at all. They just need to look like they do. They can also be a lot more stripped down ...


6

Summary: Depict differing world-views and perspectives in a value-neutral, non-judgmental way In order to deal with prejudices, biases, and bigotry, I would focus away from artificial "This is a minority in the galaxy. It's wrong to hurt them!" style methods. It's not that it's inappropriate, but that it would be ineffective at doing anything but ...


6

every action the player takes is deterministic, however, there are events that happen on scheduled intervals I think there's your problem; your game should only have one timeline (for gameplay-affecting things). You say that certain things grow at a rate of X per second; find out how many game steps are in a second and convert that to a rate of X per Y ...


5

Whilst I agree with DampeS8N's opening paragraph (i.e. game AI only needs to be smart enough to make the player think that it's smart), I feel that this question needs a little more elaboration. The data structures in use could be FSMs for all levels, but that doesn't really answer the question as to how the individual systems work. Disclaimer: I have ...


5

Just record your game time, add it to a variable, once the variable gets to a certain amount, fire your event.


5

TL;DR A simple List<int> is enough to store all the information you need. Read on for the details. Context I'll drop in a little trick here then. Are you aware that when working with 2D matrices there's a way to index them with a single number, instead of having to provide a (x,y) pair? For instance, where is the letter d in the following matrix? ...


5

http://www.gamasutra.com/view/feature/3094/1500_archers_on_a_288_network_.php This is still how networking is done in RTS games. P2P is also the normal way of handling connections. Using a lock timestep model however results in the irritating case of desync and cheating handling. There is good way of recovering when a desync happens and all RTS games ...


5

Actually, M:tG has gone through ups and downs where some expansions were overpowered and some were underpowered. For example, most of the expansions around 3rd and 4th edition were fine but the Tempest expansion made a lot of earlier cards redundant. Maybe they're more careful now but they were still making significant balance 'mistakes' (or deliberate ...


5

What you're looking for is basically coordinated movement. The units pathfind to their destination and when they reach it, they form a "formation". This is a topic decently covered in the AI Game Programming Wisdom (Book 1, Book 2, Book 3 and Book 4) books. But, I'll refer you to the following articles: Coordinated Movement - A link explaining the ...


5

float size = 1.0 / NumTiles; float2 Base = UV - fmod(UV, size.xx); float2 Center = Base + (size/2.0).xx; return tex2D(ScreenTexture, Center); Make your render target be a texture called ScreenTexture, render your scene, make the rendertarget be the backbuffer again, draw a fullscreen quad with ScreenTexture and apply this shader on it. It is called Post ...


5

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 ...


4

Well paced (You can't beat the game in 5 minutes, but it wont take a week) Not driven by a single game element, so much as the overall scope of the game. Arrived at mainly through playtesting, I think. Replayable (The first game isn't your last) Mostly done through randomized starting positions and a variety of opponents that each have their own ...


4

if you are only asking about the path finding problem you can use your answer in this question, but for the whole idea of how to implement an AI read the rest of my answer. It's not always finding algorithm like A* that decide what AI should do, usually for games with too many possiblities they use some state-machine that controls the actions and those ...


4

Check out Mogre (Managed Ogre), its a Graphics rendering engine (not a game engine), which seems ideal for your situation. Mogre is a .NET binding for Ogre, so it works with C# and VB.NET. There are tutorials for both on the wiki: http://www.ogre3d.org/tikiwiki/MOGRE It is quite simple and fun to use, and should be easy to incorporate into your project. ...


4

Our life is frittered away by detail . . . simplify, simplify. (Henry David Thoreau) My answer is similar to those that suggest picking a clear role for the player. What they're really saying is to simplify I think. The reason micromanagement happens is because there are very many choices to make during play, and in general they only really matter in ...


4

This is known as 3D picking, and usually involves some kind of raycast from a point in screen space (the cursor position) in the camera's forward vector direction. For some Ogre tutorials, check those links: http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Intermediate+Tutorial+3 http://www.ogre3d.org/tikiwiki/ThreeDeeObjectPicking ...


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

That sounds like a really bad idea. For multithreading to work well you need individual tasks that require significant computation, and can be easily segregated so that they don't work on the same dataset. There is an overhead to each new thread you use, there is in some cases a big overhead for shipping data between threads, and once you have occupied each ...


4

First, to solve the problem with scheduled events, don't broadcast the events when they happen, but when they're initially scheduled. That is, instead of sending an "increment the energy of tile (x,y)" message every second, just send a single message saying "increment the energy of tile (x,y) once per second until it is full, or until interrupted". Each ...


3

Depending on the nature of your achievements you could also introduce some kind of "marker achievements". If you have for example 3 consecutive achievements: Wood 1 - Collect 100 wood Wood 2 - Collect 500 wood Wood 3 - Collect 1k wood Then it would make sense to just register an OnChange event for the first achievement until the player completed it. Upon ...



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