Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411432 Posts in 69363 Topics- by 58417 Members - Latest Member: gigig987

April 20, 2024, 05:00:37 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Animate (CPU vs CPU) turn based match during fight calculation or after?
Pages: [1]
Print
Author Topic: Animate (CPU vs CPU) turn based match during fight calculation or after?  (Read 711 times)
randomThrowAway
Level 0
***


View Profile
« on: February 01, 2016, 03:05:00 PM »

I'm not sure which way is better:

Right now I have a MatchData class which holds a whole match's MatchRound objects which in turn store one turn's data (moves, scores and so on).
I have a MatchDataReader which can read MatchData and then interprets / animates it turn by turn.

I'm not even 100% sure why I did it this way, it felt kinda unnatural to do the animation stuff during the actual match calculations, especially since I can't animate in real time anyway, the match calc is so fast it does 100k+ matches per second, so if I did it that way I'd have to pause the calculation after every step and wait for the animation to complete.

I guess having the MatchData has the additional advantage that I can store it and use it in replays or whatever? It's more work to write though, and I'm not sure at all if I'm simply stuck in an unnatural way or if it's maybe standard to do it like this, even.

Obviously this wouldn't be a viable method if the player had any way of influencing / interacting with the match, but they don't.
Logged
Raptor85
Level 5
*****



View Profile WWW
« Reply #1 on: February 01, 2016, 05:45:15 PM »

99% of turn based strategy games calculate first then animations is just a visual of what already happened (which in most good games can be turned off in the menu).  The only rare exceptions tend to be games that allow interruptions or button inputs to counter-attack/power attack/etc based on things happening in the conbat..
Logged

-Fuzzy Spider
randomThrowAway
Level 0
***


View Profile
« Reply #2 on: February 02, 2016, 04:17:07 AM »

Thanks man, after sleeping on it I'll keep my current setup. I guess I was a bit sad to close the door for midmatch player actions but really, there is no need or even a good (game world) reason for the player to be able to influence it, anyway.
Logged
randomThrowAway
Level 0
***


View Profile
« Reply #3 on: February 02, 2016, 07:35:13 AM »

Hm, I'm actually on the fence again (I avoided the issue today and worked on other stuff). What about doing a hybrid mode where I calc each match round in full, then stop to animate, then calc the next round and so on?

That way I can avoid having to save a lot of variables each turn that would only seldom get used. Let's say it was a boxing simulation, I'd not only have to save the HP but also stuff like "Used X kind of punch with left arm this turn" and so on, while if I call displayRound() after every round, I can just display the boxer's current state.

Although, maybe I should simply store a copy of the boxer in the round? So not only have "this happened" per round but also "full boxer state" after each round... Yeah, guess that's what I'm going to do, helps to write down your thoughts!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic