Coder Social home page Coder Social logo

genie-js / genie-rms Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 2.0 522 KB

Age of Empires 2 random map script parser and evaluator for Node.js and the browser

Home Page: https://genie-rms.surge.sh

License: GNU General Public License v3.0

JavaScript 80.08% PHP 19.92%
age-of-empires

genie-rms's People

Contributors

goto-bus-stop avatar hszemi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

genie-rms's Issues

Write script that outputs SCX files

It would be nice to also view generated maps in-game. https://github.com/genie-js/genie-scx can not quite generate SCX files yet because awestruct doesn't support the same dynamic stuff for writing as it does for reading. Awestruct likely needs a major version bump to allow that. Then this script should be fairly simple to write (if a bit tedious).

implement Map#cleanTerrain()

This was low priority for me at first but I think it's quite important in order to make generated maps look decent. The terrains this project generates right now are very holey and jagged compared to the nice lumps generated by AoC.

Add the `if` in comments parsing bug

this is fixed in UP 1.5 but can have a significant effect on maps before that. I think the commentDepth check in Parser.js#parseToken needs to be moved somewhere down.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

TODO list

adding things i remember off the top of my head, to be extended—

1.0c compat:

  • "team together" player positioning
  • elevation generation
  • place cliff objects in cliff generation
  • place walls better. maybe not as advanced as AoC's to start, it calls into the AI code to place random map walls
  • add a way to do civ specific things, like the chinese +3 vils bonus or the meso scouts, ideally not hardcoded
  • shallows
  • options that map to the various RMS constants, to allow if LOW_RESOURCES etc

UP compat:

  • grouped_by_team
  • direct_placement
  • support for ZipRMS using genie-scx
  • maybe record effect_amount and such somewhere? so you can use genie-rms + genie-dat to determine actual stats for a game?

Make the Parser.end() return value serializable

  const content = fs.readFileSync(require.resolve('./test/Arabia.rms'), 'utf8')

  const parser = new Parser({})

  parser.write(randomMapDef)
  parser.write(content)
  const parseResult = parser.end()

  console.log(parseResult)
  console.log(JSON.stringify(parseResult)) // json serialization
  expect(parseResult).toMatchSnapshot() // jest snapshot testing

I wanted to experiment with adding some automated tests, but strictObject.js Proxy seems to prevent me from doing any kind of serialization / snapshot testing:

TypeError: toJSON is undefined

       6 |       const val = target[prop]
       7 |       if (typeof prop === 'symbol' || whitelist.has(prop)) return val
    >  8 |       if (val === undefined) throw new TypeError(`${prop} is undefined`)
         |                                    ^
       9 |       return val
      10 |     }
      11 |   })

      at Object.get (src/strictObject.js:8:36)
          at JSON.stringify (<anonymous>)
      at Object.stringify (src/test/Parser.test.js:16:20)

Or alternatively with jest:

PrettyFormatPluginError: $$typeof is undefined

       6 |       const val = target[prop]
       7 |       if (typeof prop === 'symbol' || whitelist.has(prop)) return val
    >  8 |       if (val === undefined) throw new TypeError(`${prop} is undefined`)
         |                                    ^
       9 |       return val
      10 |     }
      11 |   })

      TypeError: $$typeof is undefined
      at Object.get (src/strictObject.js:8:36)
      at Object.<anonymous>.exports.test.val [as test] (node_modules/pretty-format/build/plugins/react_test_component.js:71:48)
      at findPlugin (node_modules/pretty-format/build/index.js:318:22)
      at printer (node_modules/pretty-format/build/index.js:330:18)
      at printListItems (node_modules/pretty-format/build/collections.js:135:9)
      at printComplexValue (node_modules/pretty-format/build/index.js:224:43)
      at printer (node_modules/pretty-format/build/index.js:344:10)
      at printObjectProperties (node_modules/pretty-format/build/collections.js:170:21)
      at printComplexValue (node_modules/pretty-format/build/index.js:270:48)
      at prettyFormat (node_modules/pretty-format/build/index.js:499:10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.