Coder Social home page Coder Social logo

cs354r-rpg's Introduction

CS354R Bullet Hell RPG

A bullet hell action RPG with a pretty awesome replication framework.

Build Status

Build instructions

  1. Install JDK 8
  2. Set up your PATH to use JDK 8 (lab machine note: export JAVA_HOME=/lusr/opt/jdk1.8)
  3. ./gradlew build test
  4. ./gradlew :desktop:run -- this will connect to the testing server.

Project structure

  • core -- Core game code. Includes client code, replication framework, and most of the unit tests.
  • desktop -- Desktop launcher code.
  • server -- Headless server code. The server is separated out so the client isn't distributed with it.
  • annotationProcessors -- dependency of core, used for appending replication information to methods and fields.

Using an IDE

The eclipse and idea plugins are enabled on all projects, so simply call:

./gradlew idea
./gradlew eclipse

to generate the project files for them.

Committing

Do not push to master. Do not commit class files or project metadata (the .gitignore will already handle this for you.) Use topic branches to work on individual issues until they're ready to commit.

Before committing, it's recommended that you run the unit tests by starting the test gradle task. This will bail out if the code itself won't compile, and will tell you what tests are currently failing.

Continuous integration

The master branch is automatically pulled by a continuous integration server to handle builds and to start up an instance of the game server. If you start the :desktop:run task in gradle, the client will start and automatically connect to the game server.

cs354r-rpg's People

Contributors

corinhill avatar hybrideidolon avatar

Watchers

 avatar  avatar  avatar

cs354r-rpg's Issues

Broadphase query system

Transform memoizing

  1. Change how world transforms are evaluated (memoized)
  2. Setup rendering and stepping to use that memoization instead of evaluating transforms itself
  3. Make transform update a special scene system, Broad phase, to let it update an internal spatial structure for broad-phase querying
  4. Have that system have a generalized query function for getting nodes within a given space.

Specifying bounding boxes

We need a bounding box system to help with this, that should be automatically evaluated on the node based on its containing nodes. Perhaps a new Spatial interface for components?

Quad tree versus grid

Grid is super simple to implement but memory heavy. However it's also much easier to handle large objects occupying large amounts of spaces, for fast querying of large and small objects.

Quad tree is better at handling varying degrees of object density. (?)

Special items

Players can hold special items that they can use that are more than just shooting (i.e. healing auras, bombs, etc)

Add an entry screen

Before the client connects, we should have a screen prompting a server address (for testing purposes) and a player name. This screen should be skipped if the values are provided at command line.

Optimize references to nodes/components in replicated and RPCs

Nodes and components, when replicated as field references, should be replicated with their network ID only. This allows a component to hold references to nodes and components in fields.

During field application, we should replace that number with an actual value.

This goes for RPC arguments as well.

Optimize replication of asset references

Assets used in components should be able to replicate the location of an asset, rather than the asset itself. This will be an explicit form for fields.

AssetContainer type

A template class called AssetContainer will be constructed with a path and a type template argument. This is a special serializable data type that only serializes the path (and perhaps a unique ID number in place of that path in the future) into the KryoSerializable.

Game code making use of AssetContainers must call .get() to retrieve the underlying asset. The implementation will refer to the AssetManager to load the asset if necessary and return it.

Generalize unit attributes

All "units" should possess stats:

  • Health/Max Health
  • Attack power
  • Attack rate

Player shooting should use those values.

Reaching zero health should spawn a new "gravestone" that has no control component and is purely visual. The server should then make the player possess that gravestone node and then remove the old player node.

Validate game version on connect

The server should put the player in an "authenticating" state before putting them into the game world. The client will then have a time limit to send an authentication message with its game version and player name.

If we complete this issue by Friday, we can set up a public download address for people to grab the game and playtest it freely. This will allow me to share it online to get more testers.

Chat box improvements

  • Disallow long messages and zero-length messages
  • Text wrapping (wrap the labels in a box)
  • Colorize player names
  • Smaller font? Maybe smaller font for entire UI
  • Remove mouse focus when a message is sent (prevent scrolling the chat UI when normally playing)

Solve concurrent player list modification bug

Rarely, the tick iteration will crash due to concurrent modification:

Exception in thread "HeadlessApplication" java.util.ConcurrentModificationException
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
    at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
    at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:400)
    at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:728)
    at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583)
    at rpg.server.KryoServerSceneSystem.endProcessing(KryoServerSceneSystem.java:233)
    at rpg.scene.Scene.update(Scene.java:68)
    at rpg.server.GameServerDaemon.render(GameServerDaemon.java:183)
    at com.badlogic.gdx.backends.headless.HeadlessApplication.mainLoop(HeadlessApplication.java:125)
    at com.badlogic.gdx.backends.headless.HeadlessApplication$1.run(HeadlessApplication.java:90)
Disconnected from the target VM, address: '127.0.0.1:57778', transport: 'socket'

Process finished with exit code 0

Possible solutions:

  • Use a lock on the player list before modifying

The existing solution does not work (synchronized blocks on playerList)

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.