128 lines
5.0 KiB
Markdown
128 lines
5.0 KiB
Markdown
# Note
|
|
|
|
This is now directed at the `src` folder. The `game` folder is old code and is
|
|
kept for example stuff.
|
|
|
|
# Goals:
|
|
|
|
Make a multiplayer game that will run in the browser. This game should be a
|
|
planet conquest type game where you can create a lobby and then players can
|
|
join. Once you start a game only those players can play. This game should be
|
|
time based. You will start with a system of planets and then over time you will
|
|
gain ships and resources. The goal is to either eliminate all of the other
|
|
players or to control a portion of the universe. As you explore you can
|
|
encounter other planets and players. Each planet will have specific
|
|
bonuses. Some can produce ships faster, others will produce more resources and
|
|
in others you can find bonuses for different kinds of ships. I want to make it
|
|
so that you can also upgrade the planets to improve the value of them.
|
|
|
|
The maximum player count in a game will be 20 however I want this to be
|
|
scalable.
|
|
|
|
# Thoughts:
|
|
|
|
|
|
I do not want the players to directly communicate with each other. I want each
|
|
one to talk to the server and then the server to use an API for getting updates
|
|
for each player and their stuff. This means that potentially there could be
|
|
multiple clients for the game however I want to start with a web based client
|
|
as I feel that is easiest for me.
|
|
|
|
Each player should be able to log in and then see what games they are playing
|
|
in and select a game to resume. The game will continue even when the player is
|
|
not logged in. This means that the player could be attacked even when they are
|
|
gone. This means that the worlds need to be persistent.
|
|
|
|
As a follow up that means that each world will be always running. This means
|
|
that if there is a main loop for the game it should be very lightweight so that
|
|
it does not consume massive amounts of resources. Another thing that I want to
|
|
have is that the game speed will change based on the number of players
|
|
online. For example, if there are 4 players in the game and all 4 are active I
|
|
want to have the game move faster so that they can play together better.
|
|
|
|
I think that each universe should be randomly generated that way the players
|
|
have to explore it.
|
|
|
|
I do eventually want to have AI players however for now I just want human
|
|
players. Make sure that you help me to keep this easy as I am programming.
|
|
|
|
Here are the resources that I am thinking of for now:
|
|
- Food (Local to planet)
|
|
- Energy (Local to planet)
|
|
- Metal (Global)
|
|
- Fuel (Global)
|
|
- Crystals (Global)
|
|
- Galaxy Credits (Global)
|
|
|
|
|
|
How do we have resources travel be tween planets? I am not sure yet. Maybe have
|
|
another type of ship called a transport that can transport resources. This
|
|
should be automated though so that needed resources are transported
|
|
auto-magically. Another option is to have some resources like metal, crystals,
|
|
and Galaxy Credits to be global while things like food and energy are local to
|
|
each planet. This way you can build production buildings on each planet.
|
|
|
|
I also want there to be some form of tech tree that the player can choose and
|
|
can research. Maybe add some rare resources.
|
|
|
|
# Vocab:
|
|
|
|
|
|
- Ship: a space ship. There are several different types:
|
|
- Explorer: Has a high vision range and can see far. It can not however
|
|
attack or defend
|
|
- Fighter: This is a ship that can fight other ships. It will also have sub
|
|
classes as well
|
|
- Colonizer: This ship is used to colonize a planet and is defenseless while
|
|
flying. However when a planet is colonized the ship can be used to defend
|
|
the planet
|
|
- Universe: The entire game space. It contains planets and other objects
|
|
- Planet: A planet that can be colonized/owned by a player. It can produce
|
|
resources and ships
|
|
- Planet Defense: Structures that can be built on a planet that will defend it
|
|
from attack.
|
|
|
|
|
|
# Final thoughts:
|
|
|
|
|
|
I am comfortable with Python and Ruby mostly. I would rather separate the game
|
|
into the server stuff which will be API driven. I have done some Ruby on Rails
|
|
however I am not very good at it. This means that I would prefer if we used
|
|
rails for it to be purely an API.
|
|
|
|
I also am very inexperienced at authentication. I think for now I will just
|
|
have player names. Anyone can use any name. This does mean however that if two
|
|
people use the same name they will be indistinguishable in the server. Probably
|
|
just taking a password and hashing it on the client and then using that hash as
|
|
a 'token' of sorts would fix this. I am not super concerned with player account
|
|
security however the server does need to be secure.
|
|
|
|
# API overview:
|
|
|
|
|
|
The `Universe` class will contain everything in the universe. This means planets, ships, and other stelar objects. This will be the API that I can think of:
|
|
|
|
## User accesible API
|
|
|
|
This is the API that the players will be able to access:
|
|
|
|
```
|
|
universe/
|
|
- players/
|
|
- planets/
|
|
- buildings
|
|
- fleets/
|
|
- fleet1/
|
|
- ships/
|
|
- fleet2/
|
|
- ships/
|
|
ships/
|
|
- tech/
|
|
```
|
|
|
|
## Admin/server API
|
|
|
|
I want them to be able to do anything in the game incliding normally illiegial
|
|
actions.
|