nelsonxb / graphpaperracegame Goto Github PK
View Code? Open in Web Editor NEWImplementation of Racetrack (graph paper game)
License: MIT License
Implementation of Racetrack (graph paper game)
License: MIT License
The players need to be able to change how many vehicles are on the track.
Currently, we are relying on Slick2d's states. If Slick is going away, then we need to switch the system. IIRC, LibGDX has a built-in state system.
The player can skip outside of the track if in one turn they jump over non-track tiles. There is also some weird behaviour if the player keeps going.
I could use Bézier curves to smooth out the edges of the track without altering the shape, as is done with in the analog version. The maths is seriously deep and programmatically difficult, and the benefit gained minimal. This is therefore extremely low priority.
We need to be able to select track files from a menu, rather than switch between them with a key.
GPRG doesn't currently use states. It should.
Slick2d actually comes with a state engine, apparently, so there's that.
Render and update code will surely need to change when changing graphics libraries.
There needs to be some clearer rendered indication of whose turn it is currently, possibly also whose turn is next.
It needs to be possible to restart the game:
This game needs local multiplayer - two people on the same computer can play together. Will use the same controls for all players (turn-based).
A few classes which may otherwise not need any porting still import a few Slick2d classes (e.g. Vector2f is common everywhere). These need to be switched to corresponding LibGDX classes (if existing).
Currently, a circle is rendered at the next principal point to indicate where the players can move. It needs to be clearer exactly what options are available, perhaps a dot on each of the possible next turn points.
I think that the currently selected point should also have a slightly different shape (perhaps a smaller, filled circle?).
I really wanted to try and avoid this - particularly once the first milestone was released. Oh well.
The theory with the current format is that we read in a TrackInfo.VersionX object as a TrackInfo object, check the version number, and proceed. Unfortunately, I realized that the first bit won't work, as the JVM still needs to try and read is as a TrackInfo.VersionX, and if that version doesn't exist we are going to have massive errors.
The .track format will have to be changed to where the version number is serialized individually before the TrackInfo object, so we have a chance to figure out if something went wrong.
Requires #26
We need to be able to locate and use tracks from the file system.
We should also store previously loaded tracks to make it easier to get them later.
Track format needs header block for metadata.
Upon a little investigation, it appears that the main Slick2D development is stale (no changes since mid-2013 on the development branch).
This means that if there are any issues with Slick2D (e.g. #9), they won't ever be fixed unless we create our own fork and try to fix it ourselves (and after briefly glancing at the Slick2D repo - just no).
It would definitely be worth our while to port to another framework. A few of the others I've seen also abstract the differences between the desktop and other devices (e.g. Android, iOS), which means making the game available on those platforms would be a piece of cake (pretty much just a few extra lines).
There is a page on the LWJGL wiki naming a few 2D libraries that are based off of LWJGL (or have multiple possible backends, one of which being LWJGL).
I want GPRG to be the best it can be - and I don't think that it can be that while it is stuck on an old framework.
Yes, it would take a fair amount of work to perform the refactor (a milestone of its own), but I seriously think that it would be worth it.
Track file header doesn't seem to work when the exact same class is recompiled.
Requires #20
We need a GUI for a well-done game, and this would be the best place to start.
Main menu needs:
We need to be able to distribute this in a manner that makes it accessible.
This means a "fat jar" containing all dependencies that will auto-extract the LWJGL natives.
The camera should center itself on the current player when their turn starts.
Perhaps also on a keybind (so the player can easily find themselves again).
Once the player passes the finish line, the game needs to be won.
LibGDX may have a different input system, and we need to modify our input handling to match.
Requires #21
We should be able to customize various parts of the game, including:
This should be done in an options menu.
Initially, we just need basic track selection - the options could possibly even be hard-coded - just some way to choose between a few default tracks.
The ability to zoom out and see the rest of the track is pretty important.
This will also involve a refactor delegating the actual drawing of things to the Camera class.
Natives in mac aren't resolving correctly (last I saw, based off of @RSteyn's experience). Gonna need some way of fixing that in Gradle.
This causes a crash almost immediately upon opening the game.
It is known that switching windows while playing causes a crash on Linux running with recent XOrg.
This is a problem with LWJGL and/or XOrg. It appears to be related to another error in XOrg affecting other (non-java) applications (e.g. ValveSoftware/steam-for-linux#3364) (_xgeWireToEvent: Unknown extension 148, this should never happen.
, the error message mentions request_code: 148
).
This is not an error in the game itself, but (probably) in XOrg or LWJGL. This issue indicates that we are aware of the problem.
On some tracks, the first move you have to make in order to go in the desired direction will win the game.
Currently, only trivial cell-by-cell movement is implemented.
A player has to choose the next move based on the velocity of the previous move.
Details on movement are described on the Racetrack Wikipedia page.
Requires #21
I think there should be an overlay showing a bit of information. This should be started for v0.3, but is more a placeholder for once we get online multiplayer.
At the moment, crossing the finish line, so far as I can see, does nothing.
We need a GUI (for menus etc.) soon. But, before we get one, we need to decide on how the GUI will be created.
There are a number of options (some found on LWJGL wiki):
The script that generates a .track
file from a .png
image could possibly be put inside the game, rather than exist as an external script/application.
Either way, having it as a script is not how we want it done - it should be able to run standalone (i.e. as an application).
If a track has no start line, the game crashes.
This is due to the part of Track
that gets the next player start point returning null, which in turn causes a null player to be added.
Wed Nov 26 20:18:27 NZDT 2014 ERROR:Cannot invoke method render() on null object
java.lang.NullPointerException: Cannot invoke method render() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:88)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at io.github.nelsoncrosby.gprg.GPRGame$_render_closure12.doCall(GPRGame.groovy:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.Closure.call(Closure.java:423)
at groovy.lang.Closure.call(Closure.java:439)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at io.github.nelsoncrosby.gprg.GPRGame.render(GPRGame.groovy:140)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:688)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:411)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:321)
at org.newdawn.slick.AppGameContainer$start$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at io.github.nelsoncrosby.gprg.GPRGame.<init>(GPRGame.groovy:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
at io.github.nelsoncrosby.gprg.GPRGame.main(GPRGame.groovy:179)
Wed Nov 26 20:18:27 NZDT 2014 ERROR:Game.render() failure - check the game code.
org.newdawn.slick.SlickException: Game.render() failure - check the game code.
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:691)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:411)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:321)
at org.newdawn.slick.AppGameContainer$start$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at io.github.nelsoncrosby.gprg.GPRGame.<init>(GPRGame.groovy:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
at io.github.nelsoncrosby.gprg.GPRGame.main(GPRGame.groovy:179)
Disconnected from the target VM, address: '127.0.0.1:36040', transport: 'socket'
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.