Simulation Math

This topic is 3038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi, I'm a beginner at game development. I'd like to make a browser-based game which will involve simulation of results. For that, the user will set parameters and the server will make simulations with the values previously set. I'd like to get help with the math involved for this kind of thing I want to make. I was thiking of, for example, Warcraft 3 (Dota), the heroes have certain characteristics, when they interact these values are computed: the damage varies in a specific range (how can I simulate something like this?); as the duration of game increases, the heroes develop (change) their values given enviroment characteristics (for example the experience). How can I do things like this? I'd like to understand the math behind. Do you understand what I want to make in the simulation? Thanks in advance!

Nobody? :(

Share on other sites
Most of what you are talking about sounds like pretty straight forward BEDMAS. If you want to get funky you could add differentials, probability distributions, maybe some Monte Carlo :P Not exactly sure what the question is though, it sounds like you are asking how to do math and that's a pretty broad topic to cover in a paragraph or two. I apologize ahead if I missed some subtlety in my translation or am not aware of what browser-based game simulations truly entails. o-o

Share on other sites
I wanna simulate a soccer match. The user can set up strategies, set specific players [with specific characteristics - parameters], etc, and then I will compute the match result based on these values. I need, then, some math functions that help me to make the result be non-deterministic [within a specific range]. I also need some math to compute players' [the soccer players] characteristics as time is elapsed.
Thanks for the answer, what you say may be useful. I will read them. But, now, that I explained better what I wish [I hope so :)], maybe you have even better suggestions [besides the good suggestions you already gave]
Thanks again.

Share on other sites
I dont know what language you're using so i'll just use english :)

You should start by creating a class for your player. The game will then be composed of two collections of these player classes, the teams. You could wrap the team in a class to keep things tidy if you want, but since theres' only two it's sort of optional, if you just construct your functions intelligently. IE calling a function and passing a data structure to it is essentially the same as calling the function as a member of the data structure.

So anyways, you have these player structures and you have a function thats like StepPlayer( Player& p, float elapsedTime ). This function will apply the logic used by a soccer player, such as:

If I have the ball and i have a shot, shoot.
If i have the ball and my team mate is ready for the ball, pass him the ball.
If i dont have the ball, move to the most appropriate position to receive the ball.
If the game stops, rehydrate myself and remove wedgie.

Call this for each player and it should just work itself out :)

You can make it non deterministic by using a random generator and checking for a random condition when you make shots and passes, the probability of success based on the player and opponents skill and energy level, to determine whether the maneuver was successful.

Share on other sites
As I was reading Monte Carlo uses Probability Distributions. Maybe, if I use this math combined with what bzroom said [which was a brilliant idea], I can get good results. But now I see it is trickier than what I thought, because that way I could determine the players actions [shoot,pass,etc], but one thing is a little bit harder to do, to make the players have good positioning on the field.
If you have more suggestions I'd be very glad. I want to do something like www.hattrick.org in the beginning, only with text outputs, but for the engine [the simulation] I want to make something really good. Later, I will try to add graphics of the already implemented simulation, and get to something like http://www.footballmanager.com
That is more or less the idea.
Thanks again.

Share on other sites
Well, the team is almost finishing the requirements specification phase and the analysis has just started in parallel. We will have sooner to add the simulation process description [including the things discussed here, thanx again] in the design phase :) . I'd like to ask you guyz your opinion about what I intend to do, things like: do you think this will have acceptance by the public? Which things to consider when trying to implement something which already exists, but with some more attractive functionalities?
Thanks again.

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 36
• 23
• 13
• 13
• 17
• Forum Statistics

• Total Topics
631703
• Total Posts
3001814
×