-
Notifications
You must be signed in to change notification settings - Fork 12
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
Temporary Power-Up Items #47
Comments
Ok, I like it. We can also simply have them be worth 10 points each. Have you given some thought to the format of the getPowerUp message? we also want some of the game mechanics to be tunable, such as how long a power of last for on the in the arena. Just wondering what other tunable parameters would be needed. What would the server arguments be to turn this on and off? Will there be just on offer would there be other server arguments? |
Maybe first just making them worth 10 points would be easiest. I will work on this instead, because team bot is very painful to do. I'll look into how to write it. |
OK, this is a big one since it requires a new server message and code changes in lots of places. Please give me a description of how it will work and what parts of the code you will need to change before you start. What will the data look like that the server will store and manage? What will the message from bots look like? How will the server create and delete items? How will the server detect a robot getting item? I think this is all doable but I want to keep you on the right track. FUN! |
If you are smart, I bet you can do all this with only 50 lines of code! |
@MCSnapTurtle I was thinking about the robot/server message format. Here is one idea. It assumes a lot so feel free to propose other ideas: getPowerUps Message Robot Sends: Server Returns:
The nice thing about this is the the 'powerUps' list could be stored in d.state['powerUps'] in the exact same format. 'powerUpsEnabled' would be stored in d.conf['powerUpsEnabled']. That would make things easy. |
Sounds good! In the server code, would using a modified variant of the jam zones be suitable for creating and colliding with these power ups? |
It depends on what you are thinking. I was assuming that power ups are just point objects, not circles. The viewer may have a fancy display but in the server they would just be points. As long as any part of a robot touches that point then they would pick it up. In this case the JamZone code has a way to pick random x,y points. I assume there would be no power ups at step 1 of a game. So they would appear as time goes on. Therefore the code to add them would need to be triggered in step(). The actual code to add them could be it's own function called from step(). As far as choosing the position of power ups. I suggest they are at least bot radius away from any wall and at least bot radius away from any robot with health > 0. Besides that the layout can be random. Look at the jam Zone and obstacle code for ideas on how to check distance and overlaps. Ask more questions if you need help. |
We should talk about server arguments as well. This is one option: -powerUpOdds 0 # defaul value,, power Ups are not enabled We could actually store 'powerUpOdds' in d.conf and not have 'powerUpsEnabled' as suggested above since powerUpOdds already does the same job as powerUpsEnabled and more. |
Ok, nice suggestions, I'll see what I can do. |
So far, here's a list of things that I must add to get the feature to work:
-create a function that randomly places power-ups I'm not sure whether I should use something like mkObstacles to place the power-ups or have the code inside step(). Are those mk functions supposed to be used only when initializing a game? or can they be called later at any time? -function to check whether bot is overlapping with power-up So, something like a modified findOverlapingBotsAndObstacles function, with lists changed accordingly and with the radius of the object removed? -remove power-up after collison, or after a certain amount of steps has passed Sorta like deleting a shell? -draw/delete power-ups in the viewer @dbakewel is there a "suggested" implementation order? (ie. easiest to work with, and easy to test as I go along) |
Forgot to add: -once a bot collides with a power-up, they should be given a set amount of points (and possibly in the future, have an actual power-up, but that may be a bit too difficult for me) |
OK, I'll look at this tomorrow afternoon and give any feedback I can. |
This is the order I susggest you do this in:
I would log all actions of powerUps() for now until we get the viewer working. This can all be in one function because you do all the mk, check overlap , and remove work every step. That is why it makes sense to all be one function. You could put it in three functions and then call each in step() one after the other. That may be more useful down the road. Either way is fine with me. Do what's above first and then put in a pull request. I'll have a look before we move on.
Do another pull request for this code.
|
Regarding finding a spot for a powerUp. mkObstacles() is a good model but your code will be different. mkObstacles() is good because is does three things you need:
So yes, mkObstacles is a good model to use...but with some changes. |
Due to time constraints, I will not be able to implement this. |
Randomly generated items should be added to the game. When a bot collides with the item, they get the power-up. The location of the power-up should be random, and they should 'de-spawn"/ disappear after ~250 steps. There should be a max of 2 power ups per game.
Power-ups examples:
-invincibility (aka Can't take damage) for 100 steps (bot will not take any damage)
-immortality (aka Can't Die) for 100 steps (bot will take damage, until at 0.1% health, then it will stop taking damage)
-faster turn rate (aka turn like at 0% speed, regardless of speed) for 100 steps.
Bots can ask the server for the location (x, y) of the power-up.
Describe alternatives you've considered
Bots can shoot the power-ups to get them instead of having to collide with them.
The text was updated successfully, but these errors were encountered: