Solved Minigame Structure Help?

Discussion in 'Spigot Plugin Development' started by Azmidium, Feb 28, 2016.


  1. Some background:

    I am trying to develop minigames. If you look on my profile I have coded 4 plugins and I slowly progressed in each one of them, each of them slowly getting more complex and less bugs. I haven't uploaded in a long time and I think I might've doubled in knowledge on compacting the code, don't give me the stupid answer of "learn java.". It really doesn't help when I try teaching myself how to make a multi-instance minigames when that's the only answer given on any forum. I learn off forums and a little of YouTube when I am stuck on something, yes I know YouTube is terrible for learning but like I said most forums have people who say "Learn java/bukkit".

    I don't like getting spoon fed code, I don't think anyone would do that for a minigame/any plugin anyway, can I get please something to help me layout my classes, for example:
    ArenaManager.java
    - getArenas() method - gets arenas
    - etc.

    I think this would help future bukkit/spigot developers to layout their plugin including myself when they start developing multi-instance minigames. :)

    Thanks for reading my forum, and an extra thank you if you help me ;)!

    Sincerely,
    Azmidium
     
    • Optimistic Optimistic x 1
  2. multiarena ou bungeecord?
    the structures are different
     
  3. Choco

    Moderator

    In all honestly, if you want to start making a minigame, think of a few things before even executing your code.exe program ;P

    1. What do you want you minigame to be like?
    Think of a design for your game. How are you going to make your minigame unique, and what are you going to do to make it something that people will want to use?​
    2. Think small, then progress over time
    It's better to have a small, functioning minigame, rather than a huge, over-complex, broken, ugly, disgusting, boring, not fun to play minigame. Take a second to relax, think through what you're going to do, and make sure it's the right choice before you start hacking away.​
    3. Be prepared
    With a minigame, there's much more you have to do rather than just a plain old plugin that adds extra functionality to the game. It's definitely more object oriented, so be sure to have a huge grasp and feel comfortable with using many many many classes. Organization is key, so keep your loads of classes in their respective packages so you know where to look when you're looking for something in specific​
    4. Have fun, but don't give up
    There's times where you will find yourself stuck on something. I know that I've come across many of issues that stumped me for the longest time. I suggest Googling your answers first (hopefully leading to either an archived Bukkit or Spigot thread), if you can't find anything, make a thread about your issue in specific. But try fixing it on your own first. Good learning experience :D
    Yea, that's pretty much all I have on minigame structure. Once you make one minigame, you'll have enough experience to make a couple more minigames even better than your first one. Your first minigame isn't going to be Mineplex or Hypixel quality. It's going to be small.

    Always remember, the user comes first. Make things user friendly ;)
     
    • Agree Agree x 3
  4. Multiarena. :)
    I am not much of a Bungeecord developer so I would rather develop on a platform I understand. Since I don't do Bungeecord development I wouldn't know if it would be a small or large difference. I can post this same type of forum in the future on the Bungeecord development page when I feel the need to upgrade from regular Spgiot. :)

    Okay I am not exactly going for a large minigame, I wouldn't really see a difference in the way the plugin would be scripted decides the fact it might have more classes controlling different objects/items/tasks/etc. I am looking for like a widely accepted way of making a minigame plugin. I know how to make a single instance minigame plugin in my own way, probably terribly coded, but I have attempted several times and failed. I would just like a format, maybe code examples (like how to setup a listener to function with an arena, not actual stuff inside of the listener to function a specific feature for game, that's for me to deal with. ;)). I have always taught myself through forums and my own research, I only recently went to YouTube just because I didn't want to be one of those people who ask about EVERYTHING on a custom minigame mostly because I don't want to come off as that developer... No one likes those developers (lets be honest), or it may be the vibe that is sent through the forums. I ENJOY programming, just it is always been a goal for me to develop a minigame, I have several ideas and I know how to code all the ideas, it's putting together the actual minigame system which runs the arenas is the only issue. I am prepared to work several months on my ideas, I am currently 13 years old and have worked with Spigot for about 1 year, I have wanted to be a developer when I have grown up every since I started. Small progress over time I have done, most of my time in the last 3 months have been EXTREMELY slow, I haven't found a new minigame forum or anything on an updated system (Maybe the old system works, but it is confusing and doesn't exactly layout most key features for plugins).

    Thanks for taking the time to read my post, hopefully nothing comes off as needy or asking to much (I always feel that way).

    Sincerely,
    Azmidium

    P.S: Thanks for taking the time to read through my overly-long possibly-confusing post, also thanks for helping in advanced. :)
     
  5. i think the arena structures should be stored in any file and after instance in an class with the followed infos:
    Players in Game
    Start time
    and other things related to the game.

    Also, depending on minigame type, should structure an class to the minigame too and another things if u think that is necessary should be instanced else let it static

    Sorry my bad english
    I'm brazilian boy
     
    #5 Karamujo, Feb 28, 2016
    Last edited: Feb 28, 2016
    • Friendly Friendly x 1
  6. I am having trouble trying to read this, google translate isn't translating 50% of the words. :(
     
  7. refresh :)
     
  8. Thanks! It is partially what I was looking for, I was looking for a layout of a whole minigame. So all the "main" classes would be explained:
    The only ones I know of is:
    - GameManager.java
    - Game.java
    - Listeners (Wouldn't be a class, but I would like how to have a listener explained to work with a minigame)

    These are the only ones I know of, but there are also command systems and file systems I would like explained out, or the methods in each class and explain each of them with a brief description. It would help out alot, and would help me setup my minigame and other developers. :)
     
  9. Wat

    You create a class when you want to declare something as an Object, hence the object oriented programming. There isn't just "Game" and "GameManager," in some cases you'll need a class to hold a cooldown, something to reset a map, there's endless possibilities. Since you're newer to programming, I'd suggest making some sort of diagram (UML ones work pretty well for this) to map out exactly what you need before you even touch your project.
     
  10. I think you're confused on what I was asking for, I was asking for a basic layout on what goes in each class for minigame structure. All the forums I have looked at only teaches you how to use a GameManager (or ArenaManager) or Game (Game) for minigame structure. What I want is something that briefly explains what methods would go in each class for this widely accepted format.
     
  11. Whatever behaviour you need your Object to perform. Create methods as you need them, there's no set behaviour that's good for any project.
     
  12. Well that makes sense, I am not dumb (Sorry, the way you typed everything out, or the way the text is worded, it seems like you think I am dumb. Sorry if I am being mean for no reason <3).

    Some examples of a widely accepted format for making a simple minigame is a layout like these:
    - Example 1 - This only explains those 2 classes, it doesn't explain how I would go about listeners, what checks or methods go in each class?
    - Example 2 - This is almost what I am looking for as it explains what would go in each class rather then spoon feeding code, but I would like examples from each of the classes

    I hope this clears up what I mean. :)
     
  13. I'm developing a minigame which is bungeecord and multiple arena at the same time... What I did, is I created a map (key is arena name, value is arena). Here I save all arenas. Each arena contains a collection of players, a name, an Id (a server if it's a bungeecord arena) etc.

    Creating objects containing information is easy if you understand how it works.
     
  14. I love the information provided, but what I mean is what goes in your map class and your manager class.
    I was looking for a list that any user on Spigot can look at and read to easily understand minigame structure because I am not fluent in working with this stuff. Here is an example:

    - Map.java
    Has getPlayers() method
    Has a countdown() method
    Controls gamestate
    etc.

    I hope that explained how I think it would easily be explained to me. :)
    I understand, but I am looking for a small system to follow that I can branch off of.

    Thanks for helping in advance!

    Sincerely,
    Azmidium
     
  15. I usually lay my minigames out like this:

    I've got a mainspawn where everybody is teleported after the game ends or when they leave. This is saved in a MainSpawnManager. For my arena's I've got a class called arena and an arenamanager class. That arenamanager class holds a list of arenas and has some methods (such as getting an arena from a string, getting an arena from a player and getting all arenas). In my arena class I've things like spawnpoints, a list of players (you can use strings/uuids or another class called gameplayer for example). I also get a gamestate enum which contains states like waiting, starting, in game, full, resetting and others depending on your minigame. With this gamestate other classes for example events know when they have to cancel the event and when not. In my arena I also have a start and stop method. The start methods starts up the game, it teleports players, send messages, saves arena (if needed) and some other things. The stop method stops the game by removing all players, sending messages, resetting the map (if needed). In my Main class (which extends JavaPlugin) I call a setup method for all my managers. This loads up the arenas, spawns, mainspawn and other things depending on your minigame.

    This is what goes into the plugin most. Of course you need to do some other things like commands to set your arena up and you may want signs to join/leave arenas. But if you follow this you got most of it done. You can also look at the minigame I created here. It uses the same system I told you (it's a little more complex, but it still uses these main features).
     
  16. Thanks this is exactly what I was looking for. :)