Character Creator help needed

Godot Version

4.4.1

Question

Not my first rodeo coding but my first rodeo at trying to make a game😟. So, I am trying to make character creation for my game, currently, I am planning on having two way of character creation, one being going through a questionnaire and the other being you just add in the numbers yourself.
Two questions:

  1. Do I really need to make a lot of scenes? Because I made a scene for the main choice of the character creator which link to the questionnaire and customization scenes. Is it possible to do so in one single scene? I thought about using panels but it feels like quite the hassle since you have to make panels appear and disappear and whatnot. What would be a good way to handle this.
  2. How should I structure character data? Should I make them global variables or something? I have not the faintest clue at the moment.

Thanks for any and all answers in advance.

I’m a novice too, but a long-time programmer. What I’ve found is that for menu-driven scene, you want to put your menus into one scene. but separate them out because it can get messy. So for like my game start menu, I have a menu_root.tscn.

This simply has my main settings: new game, load save, etc buttons:

One of the buttons is the custom control settings button. I add another scene so that when they click configure controller, it makes that guy visible.

Eventually in my menuroot, it will have the load/save scenes.

It sounds like this is horrible and tedious to have separate scenes for everything, but it actually keeps things clean. You could stick them all into one root menu, but you’ll start coding and then say to yourself, aw crap, this is really annoying when trying to manage state for these windows.

Then attached to your main root menu, you could create a gd script which manages the button pushes:


@onready var start_button = $SettingsPanel/Panel/VBoxContainer/StartNewGame
@onready var load_button = $SettingsPanel/Panel/VBoxContainer/LoadGame
@onready var save_button = $SettingsPanel/Panel/VBoxContainer/SaveGame
@onready var controls_button = $SettingsPanel/Panel/VBoxContainer/Settings
@onready var about_button = $SettingsPanel/Panel/VBoxContainer/About
@onready var credits_button = $SettingsPanel/Panel/VBoxContainer/Credits
@onready var quit_button = $SettingsPanel/Panel/VBoxContainer/Quit

@onready var main_settings = $SettingsPanel
@onready var controller_settings = $ControlsSettingsPanel

signal start_new_game

func _ready():
	start_button.pressed.connect(_on_start_pressed)
	load_button.pressed.connect(_on_load_pressed)
	save_button.pressed.connect(_on_save_pressed)
	controls_button.pressed.connect(_on_settings_pressed)
	about_button.pressed.connect(_on_about_pressed)
	quit_button.pressed.connect(_on_quit_pressed)
	
	controller_settings.visible = false

func _on_start_pressed():
	print("🚀 Start New Game pressed")
	self.visible = false

	emit_signal("start_new_game")

func _on_load_pressed():
	print("📂 Load Game pressed")

func _on_save_pressed():
	print("💾 Save Game pressed")

func _on_settings_pressed():
	print("⚙️ Settings pressed")
	controller_settings.visible = true
	main_settings.visible = false

func _on_about_pressed():
	print("ℹ️ About pressed")
	
func _on_quit_pressed():
	print("🛑 Quitting game")
	get_tree().quit()

These are stubbed out for later, only the controller settings, start new game and quit works right now, but you get the picture.

As for how to structure your data, this really depends upon your data model, but I would create a class with the structure of what the people select and then use that within the scene that you use to configure the character and then save that structure to your game state. If you could share code I could get a little more specific.

1 Like

Yes you can do this in one scene, it’s all just nodes. Up to you if it’s better or worse for organization; you haven’t given too much detail for anyone else to weight in.

If you are switching scenes you will need to store data shared between scenes in either a global or a file. I suppose storing to a file would prepare you for the future with save systems, but globals are easy if you do not intend to do local multiplayer.

1 Like