Comments (5)
In my opinion we should discard any events if the bot program has already received an event or is currently executing an event routine
from todo.
In my opinion we should discard any events if the bot program has already received an event or is currently executing an event routine
I think this would be the best approach, too...
Another idea is, that events get a priority which determines how important they are.
I'm thinking about a case where a marker for "resources" is dropped and after that one of "help me fight" is dropped.
from todo.
I could imagine such a case (ignoring technical probs of the issue for now):
// code: go find ressources!
game.on('ressourceFound', e => {
// code: mine and bring home!
})
game.on('enemyDiscovered', e => {
// since we want to run away, we ignore `ressourceFound` events:
game.removeListener('ressourceFound')
// since we're running away, we're now looking for allies:
game.on('allyDiscovered', e => {
// code: group!
})
// code: run!
})
(Along the lines of Node EventEmitters)
from todo.
I was also thinking about this issue. My Idea would be to have the robot/unit "know" its current subroutine. When a new event occurs the programmer has access to that information and can decide himself in the event handling how he wants to continue. In your example @timgrossmann
Unit State
- current order: "get ressources"
Event (enemy detected)
- has information on the unit and the Unit state
- when handling this event can check for the current order of the unit
Inside Event: event.ENEMY_DETECTED
if (unit.getCurrentOrder() === action.GATHER_RESSOURCES) {
unit.issueOrder(action.FLEE)
}
This way we pass the problem and soultion and power to the programmer. He could also not check for the event and always take the newest event, or check if an order is present and just continue. As he pleases.
from todo.
Addressing the multiple Actions event I would suggest to have a list of events that happened in the entity as suggested here in the Object>Unit section. There is an example there.
Again this empowers the coder to chose which event to handle.
from todo.
Related Issues (20)
- Restructure project to conform with choo-cli
- Add random block
- Add variable block which contains base position
- Implement resource collection
- Implement health component
- Implement building of towers
- Implement shooting towers
- Implement attack for robot
- Combine networking with robot ide HOT 1
- Implement tower discovery
- Marker Events - Components
- Marker Events - Runtime
- Marker Events - Worker renderer
- Marker Events - Blocks
- Resource Collection
- Scout coding games HOT 4
- Tournamentmode HOT 1
- Handle interupts smartly
- Make game playable in editor
- Letzter Sprint vor der MediaNight
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from todo.