Commit Graph

230 Commits

Author SHA1 Message Date
Richard Harrington
0ee2637024 got shells (mostly) working 2013-08-21 21:47:52 -04:00
Richard Harrington
0d5f3838ac altered shooter source code to not use random numbers 2013-08-21 21:47:07 -04:00
Richard Harrington
0c4ad24a9b removed comment in shooter source code 2013-08-21 21:46:47 -04:00
Richard Harrington
3ff18fb289 changed shell constants 2013-08-21 21:46:14 -04:00
Richard Harrington
5a5fb86359 added support for shells to tick-combined-world 2013-08-21 20:36:57 -04:00
Richard Harrington
12e80d2379 added tick-shell function 2013-08-21 20:27:48 -04:00
Richard Harrington
1cb3d98701 added new shooter program; commented out because writing to SHOT not working 2013-08-21 19:33:01 -04:00
Richard Harrington
7afb653f38 changed namespace phys to physics 2013-08-21 13:23:49 -04:00
Richard Harrington
faee52fcd8 moved trig functions from shell into phys namespace 2013-08-21 13:19:21 -04:00
Richard Harrington
1a5b3e3727 separated out tick-robot code into helper functions: move-robot and update-shot-timer 2013-08-21 13:12:42 -04:00
Richard Harrington
36ea96826f changed 'step-' named functions to 'tick-' 2013-08-21 11:11:16 -04:00
Richard Harrington
8d0996bec6 moved physics formulas from robot into their own namespace 2013-08-21 10:29:44 -04:00
Richard Harrington
6be9e599e1 added firing of new shells to SHOT write-register function 2013-08-20 23:40:54 -04:00
Richard Harrington
206f44ed9e added shell module, with some trig functions 2013-08-20 23:22:07 -04:00
Richard Harrington
a632b53817 added SHELL_SPEED constant 2013-08-20 23:21:45 -04:00
Richard Harrington
63ff5c8e05 refactored 'register' to do a lot more destructuring of registers and robots passed as parameters 2013-08-20 17:45:37 -04:00
Richard Harrington
61dcd040ad got the shot timer counting down 2013-08-20 17:30:37 -04:00
Richard Harrington
ad24b7e850 added SHOT register and :shot-timer robot field.
:shot-timer does not count down yet, and SHOT register
does not release shells.
2013-08-20 17:01:42 -04:00
Richard Harrington
a32a83d24f refactored register to be able to use mixins separate from their
map keys
2013-08-20 16:02:48 -04:00
Richard Harrington
c38f82d22e moved single-use read- and write-register functions directly into the extend protocol blocks as anonymous functions 2013-08-20 15:05:03 -04:00
Richard Harrington
163ba2840b altered indentatin in register 2013-08-20 15:03:34 -04:00
Richard Harrington
07596d8fad refactored 'register' with path-to-robot-field convenience function 2013-08-20 14:57:53 -04:00
Richard Harrington
0bcff121ae altered :moving-to-spot program so it sets the gun aim to a random direction 2013-08-20 14:32:15 -04:00
Richard Harrington
e02dd126c0 each new index.html request now initiates a new game instance 2013-08-20 13:25:51 -04:00
Richard Harrington
d7d27ca9f0 moved test-programs out of test into src, renamed it src-programs
also fixed some testing bugs that were using
the old parameters for init-world
2013-08-20 12:21:09 -04:00
Richard Harrington
9b46900f9b changed width and height to robot-range-x and robot-range-y and made
them constants

because technically, the robot ranges are the maximum ranges for the
centers of the robots' bodies,
so the actual extent of the arena when
displayed must be slightly larger
2013-08-20 12:10:58 -04:00
Richard Harrington
e3b879fba8 removed 'core' dependency in handler, now depends on world and browser 2013-08-20 11:51:40 -04:00
Richard Harrington
b4b962096b separated 'animate' into two namespaces: 'terminal' and 'browser' 2013-08-20 11:40:29 -04:00
Richard Harrington
af9e5e9317 got rid of debugging statements in handler 2013-08-18 22:27:17 -04:00
Richard Harrington
49f2f47968 got animation going in the browser -- extremely hacky and full of debugging statements 2013-08-18 21:32:13 -04:00
Richard Harrington
6d429d6da0 removed initial json fetching tests from client and handler 2013-08-18 19:57:44 -04:00
Richard Harrington
044946ac93 got handler serving html file 2013-08-17 17:02:51 -04:00
Richard Harrington
689cb9d693 built 'worlds-for-browser', tied handler to it 2013-08-17 15:51:45 -04:00
Richard Harrington
e51ba68254 changed 'build-sim-worlds' to 'worlds-for-terminal', flattened data structure of results a bit 2013-08-17 15:51:10 -04:00
Richard Harrington
eccfc3fff5 added code to handler to send simulations to browser 2013-08-17 14:57:13 -04:00
Richard Harrington
295a8fc007 wrote take-drop-send function to pop n items off an agent-state 2013-08-17 14:56:20 -04:00
Richard Harrington
61a3eed9d6 changed json test 2013-08-17 01:53:35 -04:00
Richard Harrington
d567887ee6 now removing brain from all robots in sim-world construction; easier to send by json 2013-08-17 01:18:53 -04:00
Richard Harrington
db061c7c36 added report for seconds elapsed in real world 2013-08-17 01:18:18 -04:00
Richard Harrington
3111ca371a changed seconds elapsed in game world report from float to decimal 2013-08-17 01:17:43 -04:00
Richard Harrington
659898494e uncommented and spruced up pprinting convenience functions in core 2013-08-16 23:49:03 -04:00
Richard Harrington
5892d6ad89 made some unnecessary thunks into resolved values in core 2013-08-16 23:47:46 -04:00
Richard Harrington
534872d0a8 changed 'make-it-so' function in core so it takes fast-forward and fps parameters 2013-08-16 23:34:30 -04:00
Richard Harrington
a1df709c4f now only stores last world in each round when building simulation
also did significant refactoring, including changing
variable names from 'round' to 'combined-world' before
going through the simulation-pass, and 'sim-world' afterwards.

Soon, we'll make the worlds coming out of 'sim-world' a lot less
verbose.
2013-08-16 23:26:34 -04:00
Richard Harrington
9ab14a7653 commented out convenience functions in core 2013-08-16 23:25:33 -04:00
Richard Harrington
703c1939b4 removed extraneous code from world 2013-08-16 21:55:45 -04:00
Richard Harrington
12ee2260c1 got compojure going, with a few sample routes 2013-08-16 18:09:44 -04:00
Richard Harrington
02f9659df7 fixed typo in animate 2013-08-15 16:24:09 -04:00
Richard Harrington
257b6a2495 reworked hacky sandbox stuff in core.clj, to help with animation 2013-08-15 16:22:00 -04:00
Richard Harrington
39e14197f5 added animate module. works. 2013-08-15 15:37:18 -04:00
Richard Harrington
45f6947ea8 moved constants out into their own file 2013-08-15 11:31:46 -04:00
Richard Harrington
17cd71f758 removed world helper functions made extraneous by lack of tick-duration variable 2013-08-14 23:15:19 -04:00
Richard Harrington
cd1a9fabbd removed passing of tick-duration down into brain and robot
replaced with dynamic "constant" *GAME-SECONDS-PER-TICK*,
so we can alter it during tests
2013-08-14 23:12:50 -04:00
Richard Harrington
2bf499766b changed damage from '0 to 100' to '100 to 0' -- i.e., it should be called health instead 2013-08-14 17:20:47 -04:00
Richard Harrington
9e8285e86f added pprint to core 2013-08-14 16:37:35 -04:00
Richard Harrington
7d60b43a8b altered some todo comments in robot 2013-08-14 16:37:05 -04:00
Richard Harrington
1ad383a993 added line to display seconds elapsed in game world (to text display) 2013-08-14 08:16:53 -04:00
Richard Harrington
36f8dcef4e added fast forward feature to display 2013-08-14 08:16:33 -04:00
Richard Harrington
20f71db62f got :moving-to-spot test working, refactored test-programs a bit 2013-08-14 00:16:06 -04:00
Richard Harrington
166d7d3661 added some attributes to be printed during animation 2013-08-13 16:49:02 -04:00
Richard Harrington
aaccabac56 got animation timing working 2013-08-13 16:48:22 -04:00
Richard Harrington
eda0ba43fd formatted lines in display to 1 decimal point 2013-08-13 14:54:06 -04:00
Richard Harrington
af36cdebb6 fixed robot :pos-x and :pos-y generation, so they're floats 2013-08-13 14:53:34 -04:00
Richard Harrington
3ba9aee7c6 spruced up display of frames per second in animate 2013-08-12 17:52:07 -04:00
Richard Harrington
02eb04cae0 altered name and docstring for the function tying a world sequence to its tick-time 2013-08-12 17:44:46 -04:00
Richard Harrington
fdd79474d5 fixed rounding error causing some robots not to display in the text-output arena 2013-08-12 17:44:04 -04:00
Richard Harrington
c5ff1f4a6e removed :icon from robot attributes; not related to anything except display 2013-08-12 17:24:16 -04:00
Richard Harrington
4c6638a6a3 got a little reporting of position going for animation screen 2013-08-12 16:38:08 -04:00
Richard Harrington
f90b7c37a0 got terminal animation almost working, without being able to set frame rate 2013-08-12 16:20:45 -04:00
Richard Harrington
088fbea98e updated arena-text-grid so it works now. 2013-08-12 15:00:03 -04:00
Richard Harrington
6b573d8a9b added back in the icon attribute for robots, currently just the char of their idx 2013-08-12 14:59:31 -04:00
Richard Harrington
e01d375bb3 made a more streamlined method of passing attributes from world to robots 2013-08-12 14:58:54 -04:00
Richard Harrington
9cf4063603 fixed bug causing robot-step to add old pos and veloc instead of new 2013-08-12 09:42:11 -04:00
Richard Harrington
a56d210fe4 changed tick-duration so it's a parameter passed into tick-world 2013-08-12 00:13:13 -04:00
Richard Harrington
9fc3a06e7e added 'multiplier' field to all records in register
multiplier is a factor by which to multiply values
being pushed from the robot brain through
a register interface to a robot field, and
likewise by which to divide values being pulled from
a robot field to the robot brain
2013-08-11 23:33:31 -04:00
Richard Harrington
50ddd8d2b7 changed all values & calculations outside the brain to floating point
(also added stuff to the register functions that pull and push
from the brain to the robot fields, casting to integer when
pulling, and float when pushing)
2013-08-11 23:32:58 -04:00
Richard Harrington
32eac97e0c changed TICK_DURATION from a constant to a parameter that we pass into robot 2013-08-11 22:37:20 -04:00
Richard Harrington
af7618c7f9 added support for negative acceleration and fixed bug in robot
bug in robot was that we were doing the kinematic calculations
on the original robot, not the stepped one. It wasn't
causing a problem with any of the tests (even the so far
informal ones) because we weren't checking any changes
except to the kinematic info
2013-08-11 22:35:19 -04:00
Richard Harrington
64ac3c743b fixed various bugs in kinematics calculations in robot 2013-08-10 17:04:44 -04:00
Richard Harrington
2846ed4151 added iterate-worlds convenience function to world 2013-08-10 17:03:58 -04:00
Richard Harrington
7e040dfcf5 expanded core.clj inspection functions to cover robot, world and worlds 2013-08-10 15:55:26 -04:00
Richard Harrington
94cf5b3f47 added logic in assembler to distinguish between registers and labels
and thus succeeded in getting rid of the register dependency
in the assembler namespace.
2013-08-10 01:34:03 -04:00
Richard Harrington
528b18a45d fixed bugs in core.clj ppt inspection function, also made it more pretty 2013-08-10 00:55:17 -04:00
Richard Harrington
1cf9f7e42e put test programs into their own file; altered brain-test and core.clj accordingly 2013-08-09 22:01:56 -04:00
Richard Harrington
7618378083 removed unnecessary dependency on register in brain 2013-08-09 16:27:10 -04:00
Richard Harrington
2d7754c7f3 fixed merge conflict 2013-08-09 16:11:16 -04:00
Richard Harrington
c802fc811e fixed desired-v-x and desired-v-y situation
before, pushes to SPEEDX and SPEEDY were overwriting
the actual :v-x and :v-y fields on the robot,
so I made new :desired-v-x and :desired-v-y fields
to hold the aspiration for what we want the speed to be
(which might not be accomplished for several ticks)
2013-08-09 16:07:18 -04:00
Richard Harrington
6e6fd957f9 removed unnecessary assoc path functions in register 2013-08-09 16:02:40 -04:00
Richard Harrington
30a1ed781b switched to system where registers are part of the brain, not the robot 2013-08-09 15:58:14 -04:00
Richard Harrington
171fe5d5b2 fixed RANDOM register, was writing to robot-field still; now writes to register itself 2013-08-09 15:57:16 -04:00
Richard Harrington
167c8e73ee changed name of 'reg-names-by-idx' back to 'reg-names' 2013-08-09 15:26:02 -04:00
Richard Harrington
ac2c87325a changed name of reg-names to reg-names-by-index
to reflect its sole role: to be a lookup for the
DATA/INDEX pair system
2013-08-09 14:58:24 -04:00
Richard Harrington
98f7958e6a minor whitespace change 2013-08-09 14:55:47 -04:00
Richard Harrington
ea5ca28e45 put storage-reg-names inline in init-register, instead of at beginning of file 2013-08-09 14:55:30 -04:00
Richard Harrington
135aeb54a4 fixed bugs causing test of RANDOM register to fail 2013-08-09 14:43:33 -04:00
Richard Harrington
ccf23449fe restored loading of register namespace into brain 2013-08-09 14:35:53 -04:00
Richard Harrington
b9bfca221d started reworking brain 2013-08-09 14:34:00 -04:00
Richard Harrington
e6f1205164 finished reworking the RANDOM register to store max-value in the
register, not the robot
2013-08-09 14:32:17 -04:00
Richard Harrington
8620ea8bac renamed records in register namespace, to reflect where data is being
stored
2013-08-09 14:30:14 -04:00
Richard Harrington
d3ead6f74c cleaned up namespace declarations in assembler and brain 2013-08-09 13:58:56 -04:00