トピック
Ricardo Caffeine305

Simple Tactics Engine

The idea is to create a tactics game using a Minimax AI for choosing the best move. All suggestions are welcome. There will be 3 different unit types defined depending on strength and attack range. So far, this project has received contribution from Sim#one (with a 3-kanji instead of a #) with the code whose share key is: 5BNECK4E.
6そうだね
プレイ済み
返信[1]
親投稿
Lacks DHaze420
Are you planning any particular themes? Medieval Europe? Feudal Japan? Colonial America's? Steam punk alternate history?
0そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondxz
How will be the game? an isometric tactic rpg or top down rpg? Also, the 3 unit will work like rock, paper and scyssor?
1そうだね
プレイ済み
返信[3]
親投稿
Ricardo Caffeine305
@Ju: lol! guess I should try to get a decent engine first... But now you mention it, I think it'd be medieval-esque. @raimondz: Top-Down. Each unit should have different range and streng. Let's say Knight, Magician and Bowman. Knights will be strong but slow. Magicians will be medium-type and Bowmans will have long-range shots but weaker than the othe two
1そうだね
プレイ済み
返信[4]
親投稿
Ricardo Caffeine305
So, in theory, a bowman may hit several times before a knight get in range to hit him hard. Yes, RPS was considered in the gameplay. Not completely sure if that'd help the Minimax AI or render it too heavy. A matter of trying it out, I think.
1そうだね
プレイ済み
返信[5]
親投稿
Ricardo Caffeine305
Will post a diagram of the unit's ranges in hopes of clarifying that point a little. I'm having some issues on that dept. by the way. Not sure how to render the attack ranges "game board-wise". If the unit is close to the board limit and it's attack range falls off the board, the game renders an error.
1そうだね
プレイ済み
返信[6]
親投稿
Ricardo Caffeine305
This is the data matrix with all them ranges activated. characters are 1, 2, 3 and 5 are the possible places a character can move. Not final, though. Having this issue when I try to spawn a character near the board limit. Induces an overflow in the program.
1そうだね
プレイ済み
返信[7]
親投稿
Lacks DHaze420
I know it isn't the most elegant solution but would you be able to fake it by increasing the game board but keeping the size of the playable area the same?
1そうだね
プレイ済み
返信[8]
親投稿
Ricardo Caffeine305
Saw simeon did somewhat like that with his chessgame code... gotta try, it might work.
1そうだね
プレイ済み
返信[9]
親投稿
Ricardo Caffeine305
I'm checking this 0x88 algorithm and it's 'off-the-board' detection advantages. Might recreate something similar just cheching the [i][j] values. I'm writting the square contents on a matrix, but it seems it's feasible to write them on a unidimensional array and locate positions using equivalence classes. Thus, off-board detection may change depending on the way the board is stored.
1そうだね
プレイ済み
返信[10]
親投稿
raimondz raimondxz
By the way, have you thought about the maximum size of the map? You could use a matrix and unidimensional arrays to handle the entities on the grid. The unidimensional arrays should store the metadata of the entities(Sprite number, HP, Movement,Tag etc) and the matrix could store a reference to the arrays(Either the list index or a tag name).
0そうだね
プレイ済み
返信[11]
親投稿
raimondz raimondxz
Also, how would you handle the turn? Will it be like final fantasy tactics/Tactic ogre?(Each unit gets their turn based on the speed) or like disgaea or advance wars (All the units could be moved on the player's turn)?
1そうだね
プレイ済み
返信[12]
親投稿
Ricardo Caffeine305
Disgaea-like. All the units move on player's turn.
0そうだね
プレイ済み
返信[13]
親投稿
Ricardo Caffeine305
Been thinking on the best way to implement the unit's attack range. TBH, I've had no lectures on data structures or the like and I'm guessing it would give me some idea on how to do that. Not everything can be solved using arrays, I guess...
0そうだね
プレイ済み
返信[14]
親投稿
raimondz raimondxz
I think you could treat a bidimensional array(Or the same background) as a graph where each cell is a node and the relations are the adjacents cell. Then, you can use Breadth-First-Search to display the range of a unit(Movement or attack). You need to store the visited cell though... I think in two methods to do that:
0そうだね
プレイ済み
返信[15]
親投稿
raimondz raimondxz
1-Using a bidimensional array with the same size of the map. Each time you do a bfs, fill that array with 0. Then, mark with 1 the visited cells. 2-Use 2 arrays to store the visited positions.
0そうだね
プレイ済み
返信[16]
親投稿
Ricardo Caffeine305
Sounds kinda like a labyrinth automatic navigation we did early with me mates! guess I should revist that code. Thanks for the advice!
0そうだね
プレイ済み
返信[17]
親投稿
Ricardo Caffeine305
I was thinking on individually calculating a complete matrix for each unit and then just sum all the matrices in order to know how the attack ranges of each unit interact with each other but, might it be a hard task for the 3DS processors? my best bet is it might be...
0そうだね
プレイ済み
返信[18]
親投稿
Ricardo Caffeine305
And if even if I decide to do that, I'll have to deal with some other sub tasks before continuing with the game (like a matrix addition program so I can implement it on the game later). Right now I'm dealing with the cursor (so you can select a unit).
1そうだね
プレイ済み
返信[19]
親投稿
Ricardo Caffeine305
After trying to code the game using Phaser, I decided to rewrite the entire code so it behaves just like (or as near as) what I've done on Phaser.
1そうだね
プレイ済み
返信[20]
親投稿
Ricardo Caffeine305
Right now it looks like this: it's just a board with auto-center for one unit. You can move the unit by directly touching it. Key is RD3ED83V
1そうだね
プレイ済み
返信[21]
親投稿
Ricardo Caffeine305
I got robbed past week and lost my New3DS. Can I recover this program's code just downloading it with the key?
1そうだね
未プレイ
返信[22]
親投稿
Lacks DHaze420
oh no! That is horrible! You should be able to recover it unless the robber removed your program. I will try to grab it so I can preserve it for you :S Really sorry to hear your ds was stolen.. :[
0そうだね
プレイ済み
返信[23]
親投稿
Ricardo Caffeine305
Don't think those punks were even able to recognize the robbed me a videogame console, so I'm pretty sure they did no deletion... Thanks in advance, Ju.
1そうだね
未プレイ
返信[24]
親投稿
Ricardo Caffeine305
Was able to recover all of my programs for the download site. I'm still interested in this idea, but between work, social service, the last subject I'm taking at the University... and all the games I had on my robbed New3DS reset to square one, I'm finding it kinda difficult to concentrate and/or keep the pace on this here project...
1そうだね
プレイ済み
返信[25]
親投稿
Lacks DHaze420
I can understand that. They didnt just steal your ds, they stole your motivation too. It can be really discouraging to lose everything you have been building for years :( If life is too busy for silly ds games at least they can be put on the back burner for holidays and de-stressing. Cant put university on hold :p
1そうだね
プレイ済み
返信[26]
親投稿
Ricardo Caffeine305
Time of closing this post. Before closing it I have to say I modified a little the program so the king can be dragged all around the board and only over the board. Added a toggle button when 'X' is pressed and that's it. Will post final key in a while.
1そうだね
プレイ済み
返信[27]
親投稿
Ricardo Caffeine305
Project is far away from completion but I'm not planning to delve further since I'm interested in other projects and I also reached a limit on what I can do with the little programming abilities (and spare time) I have. Maybe it was kinda far-fetched? interesting project, though. My next project will be that long-time pending project in the Game and Watch style...
1そうだね
プレイ済み
返信[28]
親投稿
Ricardo Caffeine305
NEVYY3H4
1そうだね
プレイ済み
返信[29]
親投稿
Ricardo Caffeine305
Thanks to everyone and see you next time.
0そうだね
プレイ済み