-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arena definition #3
Comments
I have a few comments/suggestions here. Let me just tell that the ASCII representation seems a great idea. There's a lot of value in separating the structure with the delivery mechanism and the testability of a simple representation is indeed very important. 👍 Regarding my doubts:
|
Arena representationReally liked the AI as another squad ideia. We can just register several squads on an arena, and they are independent of whom controls them. We can have a map like this:
And as part of the level setup, we assign a human player to position 1, and a specific AI to position 2. This way, we can 3 or 4 squads on each level (like a last man standing), and of course PvP or my favorite, PvE (massive boss that can only be beaten by 2+ human squads). CoordinatesMy mistake on OBB was that all the system knew the coordinate's format. Could we make the implementation details private to the coordinate namespace? I believe so. Array or map is just a detail. What do we need?
Using a map is ok, it's more verbose, but it's more extendable. Arena operationsBoth arena and coordinate are just data-bags. The represent data and provide operations on that data. To setup a level we might have something like:
With this, the engine/core will receive an arena, operate on it, and yield a new version. For example, if we are processing move action from A to B, the engine will verify if the move is possible, then it will remove the element from A, and add it to B, and return this new arena. This is so powerful. This way we can have actions that do anything we would like. Want an action that destroys all enemies? Teletransports all puppets? Transforms all puppets into bunnies for X turns? Operations:
A basic representation: [{:coord (coordinate 1 1}, :puppet (puppet ...) :squad 1, :effects []}
{:coord (coordinate 1 2}, :puppet (puppet ...) :squad 2, :effects [{:froozen 2}]}
...] We can also have an hash that maps coordinate to the element. That's pretty fast and we'll need that because we'll query the arena a lot. But having a complex object like an array/hash as key is troublesome when serialializing to json (and we might need that). We can also have this fast hash, and have specific serializers that optimize for that. |
I feel we're getting somewhere here. :) I liked your suggestions and agree with almost all of them. The only suggestion I have regards the possible hash that maps coordinates to the elements. I had an idea that might be worth exploring. Like you said, it would be great that this map had a simple key, and not a complex object. What if the representation of this map was not exactly coordinate -> element, but a transformation of coordinate -> element? What if instead of the actual coordinate {:coord (coordinate 1 1), :id 11, :puppet (puppet ...) :squad 1, :effects []} Mind that if we use a 3 coordinate system, the ID would be 110 instead. What do you think? |
I think that the id would need to me more complex. For example, how to map Again, we can follow Sandi's advice and be independent of the key used. :) |
Yeah, my suggestion is bad because I was only considering fixed sized coordinates and that will definitely not be the case. I must confess that I gave that suggestion as a first impression on the subject but what I've been really thinking about since then is a bitmapped version of the coordinate. On your first post, you convinced me that it would be good to have a way to query a given coordinate very fast, and I still think it would be a good idea. I may have been confusing on my response but I don't think this representation should be used to replace the coordinate itself, nor should it be used for anything else other than this fast querying. So, I don't think we would need to perform any kind of transformation on this representation. Anyway, I think it would be better to go with whatever you think is best, as I trust your judgement and think you have better information and more experience on the subject. If you still think it might be worth it, I will gladly ellaborate on my proposal. |
So, are we missing something in the Arena? (no counting the code :P) |
My only doubt is if something is missing on the string representation, like obstacles or something. I think the representation you used is enough, right? |
I think we may need some more, but we can find some more ascii codes (for example, water/void flor). |
Because of elements (#9) I think that the z coordinate should be mandatory from the start. |
The player's puppets will be placed on the arena. We need a simple way to represent arenas/maps/boards. They may all be alike, but we should be able to evolve. Having a string representation can be quite usefull.
String representation
We can split the structure with the looks. This represents where the player's five puppets start and two enemies that are known as
E
. We have something that prevents players from moving on to it (walls). We can also represent other elements via ascii, but we can leave the visual for another side information.We should be able to load this string representation to clojure data structures and vice-versa. If we do this, we will be able to write pretty neat unit tests. Imagine: given the following board, if I perform a action A and B, then the resulting board should equal....".
We can build very simple arenas just for unit testing, and we can have a collection of the actual levels.
Arena API
This is tricky, I made several mistakes on OBB on this. This to consider:
[1 2]
?We need an API to:
This API will allow the game's logic to do anything.
The text was updated successfully, but these errors were encountered: