Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: world engine v1.0 #26

Merged
merged 14 commits into from
Dec 5, 2023
Merged

feat: world engine v1.0 #26

merged 14 commits into from
Dec 5, 2023

Conversation

smsunarto
Copy link
Member

@smsunarto smsunarto commented Nov 8, 2023

Overview

  • WorldContext arg name should be world instead of wCtx for better readability.
  • Component struct shouldn't be suffixed by ...Component. For ex: HealthComponent -> Health
  • Main tx, component, query, and system files should be prefixed with [tx/component/query/system] accordingly to distinguish against utils files.
  • Add & use Must function in main.go to reduce err != nil stuff

cardinal/main.go Outdated

err = world.StartGame()
Must(world.StartGame())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "world" here is a *cardinal.World, and the "world" below is a cardinal.WorldContext. I think duplicating the name could cause confusion. I'd suggest using worldCtx below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed this to w instead. i really would prefer to preserve world in system because that is the least ugly

Comment on lines 21 to 24
for i, create := range createTxs {
id, err := cardinal.Create(wCtx, comp.PlayerComponent{}, comp.HealthComponent{})
id, err := cardinal.Create(world, comp.Player{}, comp.Health{})
if err != nil {
tx.CreatePlayer.AddError(wCtx, create.Hash(),
tx.CreatePlayer.AddError(world, create.Hash(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update either in this PR or a follow up, using the iterators.

type WorldVarsKey string

const (
PlayerCount = WorldVarsKey("playerCount")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PlayersCount is only used in this file, so the addition of the WorldVarsKey type seems unnecessary.

was this key supposed to be used somewhere else in the code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, will fix that.

@@ -35,7 +35,7 @@ services:
- "9601:9601"
- "8545:8545"

cockroachdb:
postgres:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this intended?

docker-compose.yml Outdated Show resolved Hide resolved
@heronimus
Copy link
Contributor

@smsunarto I attempted to run this branch using the updated Docker Compose configuration I suggested earlier.
The DB and Nakama are running well, but the Cardinal is consistently restarting on startup without any error logs. Any ideas? :

image

@smsunarto
Copy link
Member Author

@smsunarto I attempted to run this branch using the updated Docker Compose configuration I suggested earlier. The DB and Nakama are running well, but the Cardinal is consistently restarting on startup without any error logs. Any ideas? :

image

you need to run it with World CLI that will inject the world.toml into env var. otherwise it will error because the namespace is not set

Co-authored-by: Heronimus Adie <[email protected]>
@smsunarto smsunarto changed the title refactor: clean up template to set convention feat: world engine v1.0 Dec 5, 2023
@smsunarto smsunarto merged commit c6f4daa into main Dec 5, 2023
4 checks passed
@smsunarto smsunarto deleted the scott/convention branch March 19, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants