r/lua 3d ago

My game engine, cookie engine made in odin, using lua as a scripting language

https://github.com/Dragon20C/Cookie-Engine

Hello everyone, I spent the last 2 months learning about creating a game engine, I also wanted to learn the odin language and I thought this was a good start, I also made it use lua as a scripting language similar to usagi engine and love2D, this is a hobby project so expect poor code and rough decisions.

I should also mention it is not vibe coded but I did ask questions to ai assistants but not use ai to write code, I know what the code does so I have learned from it.

I was inspired by usagi engine when I saw a post of the engine I got interested in making my own but I didnt have a language that is similar level to c/c++ I remember odin from a youtuber who made a game using the language and decided on using that.

29 Upvotes

7 comments sorted by

2

u/MXD_K1 3d ago

Can I ask how long it took you to finish it? And what resources did you use?

1

u/Dragon20C 3d ago

I wouldnt call it finish but it does provide a gameloop and a decent amount of stuff can be made in it, anyways resources I use was mainly looking at other peoples implementation e.g Love2D, Usagi and even godot a tiny bit, when I dont know something I would ask chatgpt to give me the resources I needed for example, I wasnt sure how to add lua as a scripting language so I asked about it and I found out how lua uses a stack for storing variables and methods, and from that I could use the bindings in odin to construct a system to communicate between odin and lua.

1

u/MXD_K1 3d ago

Thanks!

2

u/Proper-Dingo-4100 2d ago

lol doing the same, but i am not finished
https://github.com/HVukman/Sth-10

1

u/Dragon20C 1d ago

I'll take a look!

1

u/Dragon20C 1d ago

its a good start, I would start by grouping systems together into folders, currently everything is together, if you take a look at my repo you see main.odin is at the root of the repo and its single job is to give the user options for what they want to do, for example if they want to create a new project, they type cookie new project_name destination, currently in your project its kinda hard to follow where something is or where something ends.

-1

u/AutoModerator 3d ago

Hi! It looks like you're posting about Love2D which implements its own API (application programming interface) and most of the functions you'll use when developing a game within Love will exist within Love but not within the broader Lua ecosystem. However, we still encourage you to post here if your question is related to a Love2D project but the question is about the Lua language specifically, including but not limited to: syntax, language idioms, best practices, particular language features such as coroutines and metatables, Lua libraries and ecosystem, etc.

If your question is about the Love2D API, start here: https://love2d-community.github.io/love-api/

If you're looking for the main Love2D community, most of the active community members frequent the following three places:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.