jefflunt / pedestrians Goto Github PK
View Code? Open in Web Editor NEW(retired) A pedestrian simulation tech demo
(retired) A pedestrian simulation tech demo
The further down, and to the right I go, the faster rendering gets.
Is collision detection affected by the scroll position? This is the only thing I can think of that would affect this.
Implement the ability to add "destinations" in the game - places that pedestrians will gravitate toward when they want to be entertained. Having 1,000 wandering pedestrians causes some issues in terms of illogical pathfinding.
Pedestrians should modify the blocking map in real time as they move around the world, in order to prevent them from running into one another.
Move to an isometric view for the sim, and build the isometric renderer.
Pedestrians should wander about randomly when not given any particular direction.
Post project on Kickstarter to see if we can get funding to pay for art work.
Have the tile map's state be saved between runs. In fact, have the tile map save itself automatically every 5 seconds to default.tilemap, and default.tilemap.backup
Pedestrians should keep a full record of the physical position, and direction in which they were heading, up to the last two minutes.
Implement a key that allows the toggling of debug output.
Put placeholder images in for sample graphics
The reason is because of an IndexOutOfBoundsException. Basically, this is happening because the 800th pixel column, or 600th pixel row, when divided by the tile size, returns a value that's out of range.
The real answer to this is to simply modify the methods that get block coordinates such that they ignore out of bounds values.
The number of pedestrians on a tile map should be flexible, rather than static, limited only by the maximum memory limit that we want to support.
Every pedestrian has a personality and temperament.
http://www.personalitypage.com/html/four-temps.html
http://www.keirsey.com/4temps/overview_temperaments.asp
Pedestrians should not be able to walk through obstacles. That is, they should have predictive collision detection. Right now they just blindly follow paths, even through obstacles.
If a Pedestrian runs into a wall they should try to steer around it.
Implement a key that allows you to turn on/off the rendering of paths for Pedestrians.
Investigate the feasibility/memory footprint impact of having either pedestrians or the pathfinding code cache common paths in order to save on recalculating the same path over and over.
Right now, this isn't happening, and as a result, some weird things are happening with collision calculation.
Variables within the simulation (e.g. the formulas, config values, etc.) should be adjustable at runtime.
What we'll want to do is wrap this information in some kind of "ConfigValues" UI component with sliders, input boxes, etc. for adjusting things to allow the user to change variables in the fly for experiment/fun.
Sometimes, when just the right vectors are applied to a pedestrian, they start to go into an uncontrollable spin, or freak out. At some point they seem to snap out of it, but it, but sometimes it takes several minutes.
I believe I've fixed this by changing the Vector code so that the direction is always normalized to a value between 0 and 2*PI.
Pedestrians should be able to request that other pedestrians move out of their way. Whether or not they comply is up to them.
We should be able to support arbitrary tile map sizes, up to a certain maximum (as defined by the upper memory limit we want to support).
Give every Pedestrian a unique rendering color, above a certain brightness, so we can visually distinguish it from others on the movement field.
Implement the ability for a Pedestrian to save their state/history, and for it to be restored from disk/database, whatever.
Over time, the amount of memory used, as displayed in the app, increases. The application also slows down within 30 seconds or so. After 20 minutes or so, the frame rate drops to 9fps.
JIP (Java Interactive Profiler) should be able to shed some light here.
Work on the list of technical details (look/feel, image dimensions, animation requirements, etc.) for the art work
Very interesting way of determining steering and obstacle avoidance. In this example, it's almost as if a pedestrian's personal space projects a force that has an effect on any pedestrians coming toward them. The end result is that both the pedestrian's speed and direction is affected.
A pedestrian's vital statistics, things that keep them alive:
Pressing "R" should randomize the obstacles blocking map.
Pedestrians should not be able to path diagonally between the infinitely small gap between the corners of two obstacles.
Pedestrians should have a name, rather than being a nameless wandering zombie.
Pedestrians will currently go infinite distance to find a way around their path. This is dumb. Have them them try to go maybe a block or to out of their way, and if that doesn't work, they need to come back to their original path, or re-path their way to the destination.
Allow the removal, and regeneration of all pedestrians. This is especially helpful if you want to build a custom tile map, and you need to wipe out the pedestrians, and start over after changing the map.
But not until you have a playable version that people can easily download and run.
http://slick.cokeandcode.com/wiki/doku.php?id=open_source_games
Calculate congestion (i.e. relative number of pedestrians in a given tile), and allow the user to press a key to show/hide current congestion values.
Pressing the letter "o" while hovering over a given spot should allow the user to enable that block an obstacle, such that Pedestrians will find paths around any blocks that are currently obstacles. Similarly, the "c" key clears obstacles.
Rather than the current method of exponential decay for making pedestrians turn and adjust their speed, what you need is a way for pedestrians to simply sense their environment, and then react to it.
Your basic hit points-based attribute. 0 hit points = dead pedestrian. Anything > 1 is living, to various degrees.
Put the the path finding code on its own thread, outside of the "logic, render" loop. This will allow, among other things, for the calculation of extremely long paths without the need that it all happen within the space of a single rendered frame. Calculating a very long path, even over a space of 2-3 seconds, is probably more than fast enough for more pedestrian tasks.
Now that we have pedestrians wandering around, and we've solves the most pressing pathfinding issues, it's time to put multiple pedestrians on the same field, all wandering around.
Pedestrians suddenly turn to the left, then correct back toward the path for some reason.
With larger tile maps, we'll need the ability to scroll around the world.
The current walking and running speeds (45/120 pixels/sec) are fine for testing, but they're really much too fast for the real world.
Pedestrians, when they see they might collide with someone, should figure out between themselves who is going to go ahead. When that happens, the other pedestrian(s) should stop, and let that person go ahead of them.
The clock keeps track of the current time in the simulation. The game runs on a 24-hour clock, and a 7-day week. Months, etc. don't apply here. At this point all we're interested in is the following:
If you so an insertion sort on the pedestrians, with lowest Y, lowest X priority, the result will be that pedestrians in the upper-left portion of a tile will be rendered first when the rendering loop iterates over them. This means they will not longer 'pop' in their drawing, due to the ord in which they entered the tile.
This is just a change in controls.
How much money the pedestrian has
Basic pathfinding needs to be in place.
What we want to do is implement into the demo, a Ctrl+Click function that when the user Shift+Clicks on a spot on the screen, that the Pedestrian will Pathfind their way there.
After the path finder has found the basic path, it should then go in and try to optimize that path, to make it shorter and more efficient. Due to elements that are specific to A*, and the way the applied heuristic works, you sometimes get strange, non-sensical paths.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.