Skip to content
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

map generation #10

Closed
StoneT2000 opened this issue Aug 25, 2021 · 7 comments
Closed

map generation #10

StoneT2000 opened this issue Aug 25, 2021 · 7 comments
Assignees

Comments

@StoneT2000
Copy link
Collaborator

Probably the hardest part and I think we may be better off for now to generate seeds and then batch generate maps from the JS engine. Maps generate in about 0.6ms so this won't be a bottleneck ever. Map generation code is a bit complicated and additionally I have 0 confidence we will get the same seeds to generate the same maps unless we just call the JS code.

Let me know your thoughts.

@glmcdona
Copy link
Owner

Just had a quick look over the code. It's pretty complicated, but I think for myself porting your code directly over would be a bit easier than writing the generate automation + serialize + loader. For me this is easier just because I don't have any experience in compiling and running typescript, and I foresee me spending a an hour or two getting the typescript tooling working. Agreed the same seeds I don't think will generate the same maps since the random implementation is different I think, but I don't think that is a problem for the RL since we aren't trying to overfit to specific maps. ps. good work at your presentation today!

@glmcdona glmcdona self-assigned this Aug 25, 2021
@glmcdona
Copy link
Owner

Partially implemented in 0030d1e. Still have a bit more work to mirror the rest of your code there.

@StoneT2000
Copy link
Collaborator Author

oh dang ok I was gonna say I could get the map generation working, I know how to write a easy python script to get them, this way you can prioritize other parts of the engine for now

@glmcdona
Copy link
Owner

Ops, sorry, didn't realize you were offering to take on the task!

@StoneT2000
Copy link
Collaborator Author

been really busy with other things in Lux and other stuff but I'll have it setup this weekend, for now just use a debug map

@glmcdona
Copy link
Owner

Thanks, yeah I can tell you've been crazy busy! I finished up the map generation code porting earlier today, and I'm just working through my first test cases right now (and some fixes). I think I'm on track to have most of the game implementation done by Friday, how about we sync up Friday and see if there is a good part left that you'd be up for taking on?

@glmcdona
Copy link
Owner

Finished map generation with 60eeba3. The unit tests look like they work and the generated maps look good!

Example maps:
w,: wood
c,: coal
u,: uranium
Ca: City for team A
Wa: Worker for team A
Cb: City for team B
Wb: Worker for team B

....................................c,c,......u,
..........c,....................................
........c,c,..................u,u,..............
........c,c,..................u,u,..............
................................................
....................w,w,....................w,w,
....................w,w,....................w,w,
................................................
..w,w,..........................................
w,w,................w,..........................
................CaWaw,..........................
....................w,......................u,u,
....................w,......................u,u,
................CbWbw,..........................
w,w,................w,..........................
..w,w,..........................................
................................................
....................w,w,....................w,w,
....................w,w,....................w,w,
................................................
........c,c,..................u,u,..............
........c,c,..................u,u,..............
..........c,....................................
....................................c,c,......u,
....c,c,........w,w,........w,w,........c,c,....
................w,w,w,....w,w,w,................
................................................
................................................
................................................
................................................
........u,............................u,........
......u,u,u,........................u,u,u,......
........u,u,........................u,u,........
................................................
................................................
................................................
c,..............CaWa......CbWb................c,
c,......u,u,....w,w,w,....w,w,w,....u,u,......c,
..........u,........................u,..........
....................w,w,w,w,....................
..................w,w,w,w,w,w,..................
..................w,........w,..................
................w,............w,................
..........w,w,....................w,w,..........
........w,w,w,w,................w,w,w,w,........
........w,............................w,........
................................................
c,............................................c,
..w,w,w,w,....w,w,w,w,..
....w,w,........w,w,....
........w,w,w,w,........
........CaWaWbw,........
........w,w,w,w,........
c,....................c,
c,....................c,
........................
........................
........................
........................
u,........w,w,........u,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants