ANTIRUINS Engine

Place for discussing homebrew games, development, new releases and emulation.

Moderators: pcwzrd13, deluxux, VasiliyRS

User avatar
lerabot
blackout!
Posts: 135

ANTIRUINS Engine

Post#1 » Fri Sep 22, 2023 4:57 pm

Image

I'm releasing the first version of my 2D dreamcast engine Antiruins.

The engine backend is written in C and is pre-compiled, meaning you don't need the Dreamcast toolchain to use this tool.
Instead of C, the game code is written in Lua. Lua is a neat scripting language that is decently fast, has memory management, easy to learn, etc.
This greatly reduce compilation and debugging of the game and lets you iterate faster.

The engine currently supports:
* Texture loading using .dtex and .png files.
* Music streaming using CDDA audio.
* .wav sound effect.
* Loading/saving LUA table to a memory card.
* Displaying images in the VMU.
* Playing DreamRoQ video.

Currently supported but need better documentation/testing:
* Sprite atlas and sprite animation.
* Map loading.

A sample game looks like this:

Code: Select all

local gw = {}

local logo, sfx, bgm
local texX, texY = 320, 240
local realTime = 0

-- Game Create
function gw.create()
    -- Loads a font from a file.
    -- The font file is a texture atlas with 16x8 characters
    -- The last argument means no font resizing.
    local font = graphics.loadFont(findFile("assets/MonofontSmall.dtex"), 16, 8, 0)
   

    -- Loads a texture from a file.
    -- Find file will look for the file at /pc /rd / cd and /sd
    -- It will also look for the file in the current game directory
    logo = graphics.loadTexture(findFile("assets/logo.dtex"))

    -- Loads a .wav file in the SPU memory. Mostly used for short sound and SFX.
    sfx = audio.load(findFile("assets/login.wav"), "SFX")

    -- Loads the first .wav file in the music folder.
    bgm = audio.load(0, "STREAM")
    -- Play the music at 200/254 volume and loop.
    audio.play(bgm, 250, 1)
end

-- Game Update
function gw.update(dt)
    realTime = realTime + dt

    if input.getButton("START") then
        exit()
    end

    if input.getButton("A") then
        audio.play(sfx, 210)
    end

    -- Get the joystick of controller 1
    local joy = input.getJoystick(1)
    texX = texX + joy.x / 128.0
    texY = texY + joy.y / 128.0

end

-- Game Render
function gw.render(dt)
    graphics.setClearColor(0,0,0.5,1)

    graphics.setDrawColor(1,0,0,1)
    -- Arguments are: textureID, x, y, width, height, rotation
    local texWidth = 128 + (math.sin(realTime) * 64)
    local texHeight = 32 + (math.sin(realTime) * 16)
    graphics.drawTexture(logo, texX, texY, texWidth, texHeight, realTime * 10)

    graphics.setDrawColor(1,1,1,1)
    graphics.print("DT: " .. dt, 20, 440)
end

function gw.free()
end

return gw


It is currently in alpha stage, but my two project (The Hideout and Summoning Signals) are using this engine.
There are other fun stuff in there but I need to complete the documentation and clean up some of the code.
Feel free to inspect the lua folder to see all the function available.

You can read the documentation here
Here's the GitLab link

There is no license file for now, but consider this BSD-2.
Last edited by lerabot on Sun Oct 08, 2023 5:43 pm, edited 2 times in total.
Image
Indie Game Studio

colgate
Doom
Posts: 185

Re: Antiruins Engine

Post#2 » Sun Sep 24, 2023 1:04 am

That's cool, does dreamroq videos with audio work?

User avatar
lerabot
blackout!
Posts: 135

Re: Antiruins Engine

Post#3 » Mon Sep 25, 2023 9:51 am

It does play DreamROQ video with sound. I'm using BBhoodsta's version which is not 100% frame accurate, but still pretty decent.

I just added 2 new examples (video using DreamRoQ and how to save/load files) and will update the documentation today.
Image
Indie Game Studio

colgate
Doom
Posts: 185

Re: Antiruins Engine

Post#4 » Mon Sep 25, 2023 11:28 pm

That's really cool I'll check it out for sure.

User avatar
lerabot
blackout!
Posts: 135

Re: Antiruins Engine

Post#5 » Tue Sep 26, 2023 9:40 am

I want to start a game exemple to help people get started. The engine quite flexible and can could do shmups, Visual Novels, Platformer and 2D RPG quite well.

I feel like we have seen quite a few shmups, but I'm wondering if there are any genre that you'd like a template of?
Image
Indie Game Studio

Green Ranger
killer
Posts: 273

Re: Antiruins Engine

Post#6 » Tue Sep 26, 2023 11:53 am

lerabot wrote:I want to start a game exemple to help people get started. The engine quite flexible and can could do shmups, Visual Novels, Platformer and 2D RPG quite well.

I feel like we have seen quite a few shmups, but I'm wondering if there are any genre that you'd like a template of?


Personally I would love to see a RPG and Fighting Game template, if possible. :)

colgate
Doom
Posts: 185

Re: Antiruins Engine

Post#7 » Tue Sep 26, 2023 12:03 pm

I think moving sprites, animation and collision are the most hard concepts to learn.

User avatar
lerabot
blackout!
Posts: 135

Re: Antiruins Engine

Post#8 » Tue Sep 26, 2023 2:43 pm

Thank you for the feedback. I'll make a template with a simple character movement for a 2D RPG and add simple collision as well.

I think I even have basic support for Tiled Map (https://thorbjorn.itch.io/tiled) somewhere.
Image
Indie Game Studio

User avatar
lerabot
blackout!
Posts: 135

Re: Antiruins Engine

Post#9 » Sun Oct 08, 2023 5:40 pm

I added a sprite animation example and made a quick start video to help you get started.

Image
Indie Game Studio


  • Similar Topics
    Replies
    Views
    Last post

Return to “New Releases/Homebrew/Emulation”

Who is online

Users browsing this forum: No registered users