Game Idea and Help

Godot Version

4.4

Question

So, I am trying to make a multiplayer math game that I will try and post on steam… I’m kinda young (only 13) and I would love help and tips!

What part do you need advice on?

It makes it easier for us if we dont have to write a book and guess on what you know and don’t know.

I would spend some time planning out your game on paper. There are no real rules to follow just get your ideas down and organized and keep track of things you cant answer. Then come back here with specific questions and we can be more helpful.

Your first pass you may not come up with questions, because you know how it should work at a high level. If this is the case, try breaking parts of your idea down a little further into smaller parts that you may or may not be able to answer.

From your key words:
Godot Multiplayer

Steam multiplayer godot plugin

Publishing on steam costs money, and you may not be able to do so legally because of your age without your your parents help. But here is a discussion on this subject.

Wow… Thank you so much! Well, for a main question I kinda need help implementing an AI to come up with math problems and see if the player(s) got the question write in the input… I also need help implementing online and local multiplayer into it

We can get there if we work on some requirements.

Could you list the type of problems you want to see generated. And show a few examples?

Depending on your answer we can see if something already exists to use.

This will be a slightly bigger topic, but i could foresee a few low level requirements for this game. But…

Is it a heads up kind of game where players answer one question at a time the fastest? Or a whole bunch of questions, like a test, under a time limit?

How will your multiplayer work in your mind?

A few example questions… 3x + 7 = 16 what is x, A circle has a radius of 3, whats the diameter(or circumference)

The players answer questions the fastest, which gives them points… they also need to get it correct for more points…

So you will have different categories of problems.

Fpr example you can create a SolveForX class like this
Uses sting formats

class SolveForX extends Resource:
  var solution : float 
  # ax + b = c
  const question_format : String = "%1.fx %+1.f = %1.f"
  var question : String = "none"

  func _init(a:float, b:float, c:float) -> void:
    solution = (c - b) / a
    question = question_format.format(a, b, c)

  func get_question() -> String:
    return question

  func get_solution() -> float:
     return solution

You could follow this pattern for your geometry questions to.

An outer system will create this class and provide it with random numbers for the player to work against.

Scoring is pretty trivial but synchronizing for multiplayer can be very elaborate.

Local multiplayer seems more difficult. As you may only have one keyboard. One player will have the number row and the other will have the number pad. I dont think this would be a good design so you will want to incorporate a number pad UI for input into the game that could be controlled with mouse or controller input, maybe even a mapped gamepad for quicker number input. E.g. Up = 1, down = 2, … etc.

Online multiplayer makes this easier as you would not need to worry about sharing a keyboard but some of the above considerations could still apply.

For online multiplayer you will want this to be fair. If both players are equally skilled the one closest to the server ( I.e. the one with less network delay, or lag) will consistently win if you dont time sync the game instances. So we will need to periodically synchronize game clocks. This may be overkill, we could simply track the time between when the question is shown and when solution is submitted, comparing the times between the players to determine who was faster.

If you’re just starting out, I’d suggest doing this in stages. Maybe start out with a single-player version of your game that runs locally, so you can figure out how to generate questions, take answers and score them.

Once you have that, you could start experimenting with multiplayer.

I don’t see any reason why you couldn’t make the game you want, but I think you’ll find it easier (and probably quicker) to get to the finished game if you split it into smaller challenges and solve each of them individually, rather than tackling them all at once.

It seems to me like the main challenges for you are:

  • overall design; it’s a good idea to write down what you want to do in detail, maybe sketch what important screens look like too
  • making the user interface; what the player sees, how they interact with the game
  • generating questions with corresponding answers
  • local multiplayer
  • online multiplayer

Getting a design together is important for game development. It’s very easy to wind up focusing on one aspect of a game you want to build, and miss other important parts. For example, how is a game going to start? In a multiplayer game, what makes a player win, how do you determine that, and how do you present that to the players? Do you need to save any information between game sessions, like high scores? What controls will the player use? In multiplayer, is one player taking a turn while the others wait, or is everyone playing simultaneously? Are they answering the same question, or does each player have their own question?

You can start building the game while you’re designing, and the design can always change during development, but it helps to have it around.

1 Like

Yeah… Maybe we can scrap the local multiplayer… But the thing is I don’t want to script every single question… I would have to update every week or something

Simplify every challenge down into smaller bits. Before figuring out how to make 3x + 7 = 16 work, make the game do 3 + 7 = x

An equation like that will be about the simplest form of what you’re looking to generate. Something along the lines of (pseudo code):

var x = random.next(2, 20) // generate a random number between 2 and 20
var y = random.next(1, x) // generate a smaller random number, between 1 and x
var z = x - y

// then randomly select a known pattern for an equation that relates those
// one of these would be `y + z = x`

// randomly pick one of the variables to solve for,
// and adjust the question and expected answer to match

if (solveFor == 'x') {
  question.Text = $"{y} + {z} = x"
  answer = x
}

// display the question, and accept answers
// if someone provides the value assigned to `answer`, you know they got it right

// then generate another equation

If you run across a planned step you don’t know how to do, simplify it into smaller bits! You can make a new script that just runs a tiny part of what you’re doing and get that piece to work right in isolation before integrating it back into the rest of your code and trusting it to work.

(It’s harder to do this with Godot IMO, but look into the concept of Unit Testing and Test Driven Development if you really want to get into the professional approach to solving problems this way.)

edit: and once you have that working, then look at adding the next piece. Your simplest, initial implementation might hold up and keep being a good solution, but likely eventually you’ll need to redesign and rewrite something, but now you’ll only be solving one problem which you’ll have a much better understanding of

You script the category and randomize the numbers, you have a near infinite number of questions of that style.

An LLM can maybe generate questions and answers on the fly, but you would need a dedicated server just to run the AI.

mmmm… 'kay

Specifically for my example you could do this

# question list
var questions : Array 

# generate 5 random questions
for _i in range(5):
  # generate the numbers
  var a : float = randi_range(1, 20)
  var b : float = randi_range(1, 20)
  var c : float = randi_range(1, 20)

  # instance the question
  var q : = SolveForX.new(a, b, c)
  print( q.get_question(), ", ", q.get_solution() )

  # append to list
  questions.append( q )

print( questions.size() )

# prints
5x +12 = 3, -1.8
19x +6 = 1, -0.26315
1x +15 = 9, -6.0
4x +2 = 12, 2.5
1x +1 = 8, 7.0
5

@brockthegamingking by the way I’m the owner of the thread (I got notified by the link).

From what I found you can do most things if your parents sign them up for you. Mostly your problem is going to be to actually have enough money for your games, especially multiplayer. I haven’t quite gotten to multiplayer yet, because it’s a bit hard to set up. From my research, you can use either peer to peer connections or a server. A peer to peer connection basically makes it so two devices connect with each other directly but I’m still not sure how it works, exactly. The other way is to have a server that all players connect to, and this is where the problem comes. If you want to do this I don’t think you can afford hosting for it as it’s usually pretty expensive. You could technically have your computer on all the time but it’s not… optimal, to say the least. I would maybe get a Raspberry Pi or something of the sort. Also, for what you want to do you don’t need real-time multiplayer, and this problem comes up:

I don’t know how good this could work but maybe you could store rounds that players have already made, and match you with a round of those, even if it happened 5 minutes ago for example. Playing with friends would be hard to figure out though.