Jump to content

xdaniel's Random Junk


xdaniel
 Share

Recommended Posts

  • 2 months later...

My good old random junk thread... Got inspired by Antidote working on a Zelda-like engine - not by his code, just the fact that he's working on one :P - so I started working on my own, in C# using MonoGame.

 

Dunno why exactly, but it's been named "Kokoro", Japanese for "heart" or "mind". Guess because it might have the potential to become the "heart" of a game someday? Well, if this goes anywhere, which it probably won't... Regardless, there's an animated ALttP Link running around, who can pick up hearts and potions that restore health, there's a heart display with half- and quarter-hearts, there's graphics from ALttP with a few edits, and there's some sound I found online that were ripped from the game, including the customary DING DING DING DING LOW ON HEALTH warning.

 

Anyway, a quick screenshot and some debug printout stuff below.

 

 

Posted Image

 

[Kokoro started 08/04/2013 01:21:12 UTC+02:00]
[01:21:13 UTC+02:00] Created Kokoro.GameEngine
[01:21:13 UTC+02:00] Called Kokoro.GameEngine.Initialize()
[01:21:13 UTC+02:00] Created Kokoro.CameraManager
[01:21:13 UTC+02:00] Created Kokoro.EntityManager
[01:21:13 UTC+02:00] Created Kokoro.SoundManager
[01:21:13 UTC+02:00] Created Kokoro.Entities.HUD
[01:21:13 UTC+02:00] Queued entity for adding; type=HUD, hash=0x01EAF7BF
[01:21:13 UTC+02:00] Created Kokoro.Entities.Player
[01:21:13 UTC+02:00] Added sfx; name=EntitiesSoundLTTP_RefillHealth, hash=0x02A1AD9F
[01:21:13 UTC+02:00] Player life changed by 56; now at 0
[01:21:13 UTC+02:00] Queued entity for adding; type=Player, hash=0x03A51351
[01:21:13 UTC+02:00] Added entity; type=HUD, hash=0x01EAF7BF
[01:21:13 UTC+02:00] Added entity; type=Player, hash=0x03A51351
[01:21:16 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:16 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x0089DF85
[01:21:16 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:16 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x0214CC6E
[01:21:16 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:16 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x0154BDC5
[01:21:16 UTC+02:00] Added entity; type=HealthPickup, hash=0x0089DF85
[01:21:16 UTC+02:00] Added entity; type=HealthPickup, hash=0x0214CC6E
[01:21:16 UTC+02:00] Added entity; type=HealthPickup, hash=0x0154BDC5
[01:21:17 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:17 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x029264AB
[01:21:17 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:17 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x01721F68
[01:21:17 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:17 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x034707AD
[01:21:17 UTC+02:00] Added entity; type=HealthPickup, hash=0x029264AB
[01:21:17 UTC+02:00] Added entity; type=HealthPickup, hash=0x01721F68
[01:21:17 UTC+02:00] Added entity; type=HealthPickup, hash=0x034707AD
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x02603AD5
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x01696C1E
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x01E250F4
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x02603AD5
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x01696C1E
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x01E250F4
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x013EF726
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x0315952E
[01:21:18 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:18 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x0274E46C
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x013EF726
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x0315952E
[01:21:18 UTC+02:00] Added entity; type=HealthPickup, hash=0x0274E46C
[01:21:19 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:19 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x00B8956A
[01:21:19 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:19 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x018FEE19
[01:21:19 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:19 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x000D2211
[01:21:19 UTC+02:00] Added entity; type=HealthPickup, hash=0x00B8956A
[01:21:19 UTC+02:00] Added entity; type=HealthPickup, hash=0x018FEE19
[01:21:19 UTC+02:00] Added entity; type=HealthPickup, hash=0x000D2211
[01:21:20 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:20 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x021A74D4
[01:21:20 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:20 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x023CB60B
[01:21:20 UTC+02:00] Created Kokoro.Entities.HealthPickup
[01:21:20 UTC+02:00] Queued entity for adding; type=HealthPickup, hash=0x03B927C6
[01:21:20 UTC+02:00] Added entity; type=HealthPickup, hash=0x021A74D4
[01:21:20 UTC+02:00] Added entity; type=HealthPickup, hash=0x023CB60B
[01:21:20 UTC+02:00] Added entity; type=HealthPickup, hash=0x03B927C6
[01:21:21 UTC+02:00] Added sfx; name=EntitiesSoundLTTP_Link_Hurt, hash=0x00A75EBE
[01:21:21 UTC+02:00] Player life changed by -12; now at 56
[01:21:21 UTC+02:00] Player life changed by -12; now at 44
[01:21:22 UTC+02:00] Player life changed by -12; now at 32
[01:21:22 UTC+02:00] Added sfx; name=EntitiesSoundLTTP_LowHealth, hash=0x030F82F2
[01:21:22 UTC+02:00] Player life changed by -12; now at 20
[01:21:23 UTC+02:00] Player life changed by 1; now at 8
[01:21:23 UTC+02:00] Player life changed by 1; now at 9
[01:21:23 UTC+02:00] Player life changed by 1; now at 10
[01:21:23 UTC+02:00] Player life changed by 1; now at 11
[01:21:24 UTC+02:00] Player life changed by 1; now at 12
[01:21:24 UTC+02:00] Player life changed by 1; now at 13
[01:21:24 UTC+02:00] Player life changed by 1; now at 14
[01:21:24 UTC+02:00] Player life changed by 1; now at 15
[01:21:24 UTC+02:00] Player life changed by 1; now at 16
[01:21:25 UTC+02:00] Player life changed by 1; now at 17
[01:21:26 UTC+02:00] Player life changed by 1; now at 18
[01:21:26 UTC+02:00] Player life changed by 1; now at 19
[01:21:27 UTC+02:00] Player life changed by 1; now at 20
[01:21:27 UTC+02:00] Player life changed by 1; now at 21
[01:21:28 UTC+02:00] Player life changed by 1; now at 22
[01:21:28 UTC+02:00] Player life changed by 1; now at 23
[01:21:28 UTC+02:00] Player life changed by -1; now at 24
[01:21:28 UTC+02:00] Player life changed by -1; now at 23
[01:21:28 UTC+02:00] Player life changed by -1; now at 22
[01:21:29 UTC+02:00] Player life changed by -1; now at 21
[01:21:29 UTC+02:00] Player life changed by -1; now at 20
[01:21:29 UTC+02:00] Player life changed by -1; now at 19
[01:21:29 UTC+02:00] Player life changed by -1; now at 18
[01:21:42 UTC+02:00] Called Kokoro.GameEngine.UnloadContent()
[Kokoro exiting; total runtime 00:00:29.84]

 

 

  • Like 3
Link to comment
Share on other sites

Looks like you're a bit farther than I am lol, but I had to implement nearly everything from the ground up, SFML is great in the fact that it doesn't completely abstract everything out and makes you think for yourself, I'm just lazy and refuse sit and actively learn OpenGL.

 

I mean I KNOW it, I'd just rather get the thing functioning not have to deal with cross platform shenanigans, and SFML does that quite superbly.

Link to comment
Share on other sites

Heh, and that's why I have nothing but respect for anyone doing something like this, more or less, from scratch; it's much easier to do in a language like C# and using ex. XNA/MonoGame.

 

Also, bit of an update. Graphical changes with some custom graphics, added some basic code for magic power and rupees, expanded the HUD to include said magic and rupees, got a basic chasing enemy going (chases Link, damages for half a heart on collision) and added post-damage invincibility and recoil-on-hit to Link, although the latter still feels off. Also more debug button thingies to modify life, magic and rupees.

 

 

Posted Image

 

Link to comment
Share on other sites

This is how I did my damage recoil, it feels pretty close to the game (but i have yet to add the damage sprite so it looks odd)
void Link::onDamage(Entity *e){    if (m_takeDamage)    {        m_takeDamage = false;        if (Engine::instance().resourceManger().sound("player/wavs/linkhurt"))            Engine::instance().resourceManger().sound("player/wavs/linkhurt")->play();        m_invincibilityTimer.restart();        m_blinkTimer.restart();         switch(m_facing)        {            case North:            case South:            {                if (e->position().y < position().y)                    m_velocity.y += 8.f;                else if (e->position().y > position().y)                    m_velocity.y -= 8.f;            }                break;            case East:            case West:            {                if (position().x < e->position().x)                    m_velocity.x += 8.f;                else if (position().x > e->position().x)                    m_velocity.x -= 8.f;                break;            }        }    }}
Link to comment
Share on other sites

Kicked out and rewrote a lot of my entity code over the last two or so days, it's more sensical and less hacky now, entities can be serialized and deserialized to/from XML too (example below). Haven't yet remade the HUD, life, magic, rupee, basic enemy, etc. Entity movement in particular is much less hacky than it was before.

 

Player entity as it stands right now in-game:

 

Posted Image

 

 

Player entity XML - still missing a lot of player-specific stuff, tho - as exported from, and can be used by, the engine:

 

 

<?xml version="1.0" encoding="utf-8"?><Player xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">  <Name>PlayerTest</Name>  <Texture>TexturesPlayer</Texture>  <Location X="0" Y="0" />  <Color B="255" G="255" R="255" A="255" />  <Animations>    <AnimationSequence>      <Name>WalkNorth</Name>      <FrameCount>7</FrameCount>      <FrameDuration>0.025</FrameDuration>      <DoesLoop>true</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="0" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="16" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="32" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="48" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="64" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="80" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="96" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>WalkEast</Name>      <FrameCount>7</FrameCount>      <FrameDuration>0.025</FrameDuration>      <DoesLoop>true</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="0" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="16" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="32" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="48" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="64" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="80" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="96" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>WalkSouth</Name>      <FrameCount>7</FrameCount>      <FrameDuration>0.025</FrameDuration>      <DoesLoop>true</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="0" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="16" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="32" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="48" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="64" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="80" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="96" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>WalkWest</Name>      <FrameCount>7</FrameCount>      <FrameDuration>0.025</FrameDuration>      <DoesLoop>true</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="0" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="16" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="32" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="48" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="64" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="80" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>        <AnimationFrame>          <Rectangle X="96" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>IdleNorth</Name>      <FrameCount>1</FrameCount>      <FrameDuration>1</FrameDuration>      <DoesLoop>false</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="48" Y="24" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>IdleEast</Name>      <FrameCount>1</FrameCount>      <FrameDuration>1</FrameDuration>      <DoesLoop>false</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="48" Y="48" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>IdleSouth</Name>      <FrameCount>1</FrameCount>      <FrameDuration>1</FrameDuration>      <DoesLoop>false</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="48" Y="0" Height="24" Width="16" />          <Effects>None</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>    <AnimationSequence>      <Name>IdleWest</Name>      <FrameCount>1</FrameCount>      <FrameDuration>1</FrameDuration>      <DoesLoop>false</DoesLoop>      <Frames>        <AnimationFrame>          <Rectangle X="48" Y="48" Height="24" Width="16" />          <Effects>FlipHorizontally</Effects>        </AnimationFrame>      </Frames>    </AnimationSequence>  </Animations></Player>

 

Link to comment
Share on other sites

I think you can de-/serialize from and to binary data using the BinaryFormatter class, but working with XML in SharpOcarina, SceneNavi and co. made me like it a lot. It's rather easy to use for data storage in .NET, to customize the formatting of the XML document, etc.

 

Also, on another subject, I had started writing some classes for handling levels, layers and cells for maps yesterday, and a short while ago today finished redoing the camera code to 1) allow centering on and following an entity and 2) adhere to level boundaries and stop moving if the followed entity gets too close to them. Those map-related classes can also be de-/serialized from/to XML. I'll think about and look into entity-to-level collision next, I guess...

 

 

Posted Image

 

 

Edit, come to think of it, some actual comparison shots would be nice, right? :P

 

Level boundaries enabled, then disabled; also note how the "wall" layer is slightly transparent:

 

Posted ImagePosted Image

 

 

Edited by xdaniel
Link to comment
Share on other sites

  • 2 weeks later...

Sorta related to Kokoro, as in it's the result of a long train of thought regarding "A scripting engine would be cool, wonder how difficult that is...", "I really like Antidote's console...", "Damnit, I need to learn more about XNA/MonoGame...", "Crap, I've never used Lua before...", "This has become pretty meh, I'll start over...", etc. Gonna try and take it really slowly now.

 

Posted Image

 

Edit: ...switched to XNA proper. For one, I couldn't get keyboard text input to work reliably in MonoGame, even in XNA that requires some nasty stuff AND I still can't catch certain keys, such as @, € and because they require pressing AltGr and then Q, E and ß respectively with German keyboard layouts... or should I say kezboard?

 

Anyway, also been looking some more into Lua, like defining variables, etc., as well as hooking C# functions up to it (through NLua).

 

Posted Image

Edited by xdaniel
Link to comment
Share on other sites

Sort of... I was wondering what the Highest resolution was for any type of texture, What File type would be supported in maps or be best to use, and if the textures are altered at all during conversion. (Brightness/Darkness wise)http://core.the-gcn.com/public/style_emoticons/default/thumbsup.gif

 

 

The answer is:  whatever can fit into TMEM.

 

TMEM is 4KB in size, so

 

for i4, ia4 -  8192 pixels  (eg.  128x64)

i8, ia8  -  4096 pixels  (eg.  64x64)

ia16, yuv, rgba16  -  2048 pixels (eg. 64x32)

rgba32  -  1024 pixels (eg. 32x32)

 

for ci4 and ci8, you also have to take into consideration that TLUT loads the palettes into upper TMEM, so

 

ci4  -  8128 pixels (4096 / 0.5 - 16 * 2)

ci8  -  3584 pixels (4096 - 256 * 2)

 

emulator graphics plugins might handle palettes a little differently so you may be able to load ci4 and ci8 textures with the same size limitation as i4/ia4 and i8/ia8, but for hardware compatibility, these are the limits.

if you use tile 1 for multitexturing, you'll also need to take it's size into account.

 

 

 

EDIT:

Sorry, thought I was on the last page, evidently not. Just ignore that (unless you find it useful?)

  • Like 1
Link to comment
Share on other sites

Sorry, thought I was on the last page, evidently not. Just ignore that (unless you find it useful?)

 

Nah, it's alright and useful information to boot. There's a note about texture sizes in SO's Readme, but I don't think it was as comprehensive as your list is (ex. regarding texture formats).

 


About my XNA stuff... I've got an idea about what kind of engine I'll try to make. Some stupid messing around, which you can see in the screenshot below, made me think...:

 

 

... "What about a visual novel engine...?" I was already throwing that idea around in my head for a day or two, but now I think I'm gonna try this for real. The whole "scripting" idea makes sense in this context, too: Use Lua scripts for the actual scenarios and events, which drive C#/XNA functions that'll display graphics, print text, manage event flags, etc. It won't be text-based like in the screenshot below, that's just me being stupid :P

 

Posted Image

 

Also, the scripts that make up your death the "game" above:

 

Startup.lua:

printColor("-- MESSING WITH LUA - The Visual Novel --", "LightBlue")dofile("ContentScriptsDefineFlags.lua")dofile("ContentScriptsScenario1.lua")
 

DefineFlags.lua:

Flag_WasGivenAttention = 0Flag_BeenOnDate = 1Flag_NeverBeenPissedOff = 2
 

Scenario1.lua:

local GotBadEnd = falseprintColor("Let's see...", "GreenYellow")if flags.getFlag(Flag_WasGivenAttention) == true then  print("You've given her a lot of attention...")else  printColor("You might've neglected her...", "Yellow")  GotBadEnd = trueendif flags.getFlag(Flag_BeenOnDate) == true then  print("You've been on a date with her...")else  printColor("You two haven't gone on a date...", "Orange")  GotBadEnd = trueendif flags.getFlag(Flag_NeverBeenPissedOff) == true then  print("You've even managed to never piss her off!")else  printColor("You've pissed her off quite a bit...", "OrangeRed")  GotBadEnd = trueendif GotBadEnd == false then  print("Wow, you've tamed a Yandere!")else  printColor("OH CRA-!! ... Bad End.", "Red")end

 

Link to comment
Share on other sites

Makin' controls for an XNA GUI...

 

 

Posted Image

 

...which can be created and configured from Lua scripts, too!

 

 

Types.lua:

luanet.load_assembly("MikadoXNA")Button = luanet.import_type("MikadoXNA.GUI.Button")
Title.lua:

function newGameClick(sender, args) print("CLICKED! " .. args:ToString())endGUI = {}NewGame = Button(Game, "TexturesMenuNewGame")NewGame.Click:Add(newGameClick)GUI["NewGame"] = NewGame
...the way I'm fetching the button's instance and calling its update and draw functions from the game class feels crappy, tho...

 

Link to comment
Share on other sites

Lots of C#, XML and Lua later, we have a control container for less crappy updating and drawing, buttons and labels for user input and output, timers that tick and elapse, faders to fade parts of the screen in and out...

 

Posted Image

 

local Controls = ControlContainer(Game)local Timer, Fader, Label = Timer(Game, 3500), Fader(Game), Label(Game)function Fader_FadeInComplete(sender, args) print("Fade in complete, turning on the timer...") Timer.Enabled = trueendfunction Fader_FadeOutComplete(sender, args) print("Fade out complete...") Controls:Clear() ActiveControls = nil printColor("Cleared controls; here would come the next part...", Color.GreenYellow) dofile("ContentScriptsTitle.lua")endfunction Timer_Tick(sender, args) -- printColor("Timer ticking, " .. sender.SecondsLeft .. " seconds left...", Color.Orange)endfunction Timer_Elapsed(sender, args) print("Timer elapsed, starting fade out...") Fader:BeginFadeOut()endTimer.Enabled = falseTimer.Tick:Add(Timer_Tick)Timer.Elapsed:Add(Timer_Elapsed)Controls:AddControl(Timer)Fader.LayerDepth = 0.0Fader.Location = Point(0, 0)Fader.Size = Vector2(Game.GraphicsDevice.Viewport.Width, Game.GraphicsDevice.Viewport.Height)Fader.FadeInComplete:Add(Fader_FadeInComplete)Fader.FadeOutComplete:Add(Fader_FadeOutComplete)Fader:BeginFadeIn()Controls:AddControl(Fader)Label.Text = "Greatsounding Novel Title ~Lua Scripts in the Content~n169 2013 by DigitalZero DomainnnPowered by " .. EngineVersion .. " Visual Novel Enginen169 2013 by DigitalZero Domainnnhttp://magicstone.de/dzd/"Label.Font = "DialogFont"Label.AutoSize = falseLabel.Location = Point(0, 0)Label.Size = Vector2(Game.GraphicsDevice.Viewport.Width, Game.GraphicsDevice.Viewport.Height)Label.ForeColor = Color.WhiteLabel.BackColor = Color.CornflowerBlueLabel.TextAlign = ContentAlignmentFlags(ContentAlignmentCenter)Controls:AddControl(Label)ActiveControls = Controls
  • Like 1
Link to comment
Share on other sites

Started writing a dialog box control; still pretty rudimentary:

 

 

Posted Image

 

local Controls = ControlContainer(Game)local DialogBox = DialogBox(Game)DialogBox.Font = "DialogFont"DialogBox.Message = "This is a looong test! I'm testing the MikadoXNA Visual Novel Engine here! It's awesome!nHere's a manual linebreak, by the way!"DialogBox.Padding = Padding(15, 15, 20, 10)Controls:AddControl(DialogBox)ActiveControls = Controls

 

It prints the text letter by letter, and automatically inserts linebreaks if a word overflows the box to the right (in this case, between "Novel" and "Engine"). Still thinking about how to format and implement control codes for ex. text color, wait-for-keypress & next dialog box, inserting variables such as names, etc.

 

(And I lied; it's not awesome. Yet.)

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Rewritten much of the dialog box control; it still prints text letter-by-letter, and still does automatic linebreaks after words if a line would overflow. What's new: can now be set to fade in each letter as it appears, now has a nicer framework for tags, supports per-letter color and print delays, and supports a simple drop shadow by drawing each letter twice (black and offset).

 

 

Sgwo4sR.png

 

Edit, oh yeah:

DialogBox.Message = "Alright, here we go <d=22>yet again<d>. Now rewriting the <d=22><c=255,128,64>bloody dialog box<c>!<d> Here's hoping it <c=128,255,128>will actually work<c> now... I mean, this whole project is shoddy, but it should be a '<c=64,128,255>good shoddy<c>', right?"
Edit 2:

 

Manual (tag <w>) and automatic (if dialog box overflows) "wait for keypress" implemented, also fixed a few other things here and there, and added a rudimentary background image to the box:

 

RciPW9w.png

Edited by xdaniel
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Took a break from MikadoXNA over the week and went back to the buggy, experimental PC Engine emulator I was working on ages ago and never finished. Started a fresh project, imported the old code for CPU emulation, VCE & VDC, memory handling, etc., made that work properly, got the thread interaction stable (emulation runs in a separate thread), and fixed a lot of bugs in CPU and VDC in particular (the CPU's T flag not affecting certain opcodes like it should, mid-frame resolution switching not working at all, and so on).

 

So, yeah, this emulator dubbed "Miasma" is a thing and I guess I'll release it someday... like, just for the hell of it, not for it to ever become something super-accurate and all. I mean, I'll probably never get the video timing 100% right, for example. Anyway, some screenshots for now:

 

 

Uh51Lgw.pngykxaU31.pngAOUJXi5.pngX51Jo1g.pngy5iBKsA.png

 

Link to comment
Share on other sites

Miasma v0.9 Alpha 1 test build, if anyone wants (dares?) to try it out: http://magicstone.de/dzd/random/Miasma_v09A1_Test.rar

 

Some sort of compatibility list is in the Readme, but no one ever reads that file, so here it is in the spoiler, too:

 

 

1943 Kai                                Works

Adventure Island                        Works

Aero Blasters                           Works

After Burner II                         Works

Alien Crush                             Works

Barunba                                 Works (very bad sound)

Blazing Lazers / Gunhed                 Works

Bomberman                               Works

Bomberman '93                           Works

Bomberman '94                           Works (title logo flickers)

Bubblegum Crash                         Works

Taito Chase H.Q.                        Works

China Warrior                           Works

Cyber Core                              Works

Cyber Knight                            Works

Darius Alpha                            Works

Darkwing Duck                           Works (tile decoding errors)

Detana!! Twinbee                        Works (some flickering)

Download                                Works (stuck sound)

Dragon Saber                            Works

Eternal City                            Works (some black scanlines)

Fantasy Zone                            Works

Fighting Run                            Works (palette errors, very bad sound)

Final Blaster                           Works (intro resolution problems)

J.J. & Jeff / Kato-chan & Ken-chan      Works

Kaizou Ningen Shubibinman 2             Works

Kiki Kaikai                             Works

Ninja Ryuukenden                        Works

The Ninja Warriors                      Works

OutRun                                  Works

Parodius da!                            Works

PC Denjin: Punkic Cyborgs               Works

PC Genjin                               Works

PC Genjin 2                             Not working (title logo missing, hangs after title)

PC Genjin 3                             Works

Puzzle Boy                              Works

R-Type                                  Works

Salamander                              Works

Space Harrier                           Works

Super Star Soldier                      Works

Takahashi Meijin no Shin Boukenjima     Not working (black screen)

Vigilante                               Works

Bikkuriman World                        Works (tile decoding errors)

Yo, Bro                                 Not working (black screen)

 

Link to comment
Share on other sites

  • 4 weeks later...

Quick update on a few things:

 

MikadoXNA I haven't been working on recently at all, as Miasma and the awkwardly named "Project Frenda/DCEO" have taken priority over it. Miasma, in turn, I've been fixing things in here and there - ex. Shin Boukenjima should be working now - but haven't done much with otherwise.

 

Currently, "Frenda/DCEO" is my main focus, and it's something quite ambitious: it's planned to become a Dreamcast "port", more or less, of at least the dungeon crawling and battles of the first Etrian Odyssey for DS, with elements of EO4 and whatever else I can think of that makes sense. Certain basic stuff needed prior to making the actual gameplay, etc., is done or in progress - ex. basic game state management, some helper functions for simplified controller reading and file I/O, and a custom binary 3D model format with parsers/loaders for textures, materials and geometry.

 

There's a lot of optimization to be done, tho, as ex. rendering of the first room from SharpOcarina's demo scene 16 times at once drops FPS down to ~15. Need to look into DMA transfers, but there's a promising-looking article on the net about that, as well as some example code in the SDK. Speaking of the SDK, I'm not using an official, leaked one for this, but a free GCC-based environment with ex. the KallistiOS library. Well, next longer term goal is getting a dungeon floor from EO1 ported over and rendering on the DC - extract and convert the map tile models, get them loaded, arrange and render them according to the floor map, etc.

  • Like 1
Link to comment
Share on other sites

So, despite having come down with a cold (or rather "tonsillitis" I think?), I couldn't help it but work on Frenda/DCEO some more... or, well, I dove into two big things: first, slowly rewriting the whole thing in C++ as opposed to plain C, to be more object-oriented; to have each 3D model as a separate object, for example, or to have multiple text printers, each with a different font, or somesuch. Should also help with game state management, I'd imagine. Also started spinning off the "Frenda" part of the project into a separate library, as that's basically gonna be the engine of the "DCEO" project. I also did shove the whole pre-C++-rewrite project onto my local SVN, so I can return to that at any time.

 

The other big thing is fixing the performance issues with 3D rendering that I mentioned. Those have been fixed, but there's one tiny, tiny problem: every texture load pretty much negates any performance gain I got. Well, rather, the more texture loads I do, the slower rendering becomes again. Render the room 16 times, with one texture load per group per room, and we're at 30 FPS. Kinda like that... it's a bit difficult to describe and I'm still a n00b with the DC's PowerVR GPU. So, I guess I'll redo the model format to support one texture per model, which contains all the textures needed by it, which'll be "addressed" via the texture coordinates alone.

 

...or that's what I hope will work. I'm tired, not feeling well from being sick, so I'll think about that and work on it some more in a few days or so.

  • Like 2
Link to comment
Share on other sites

Quick update in the spoiler, going to bed soon, headache & slight fever.

 

 

Good news: rendering the model 16x with one texture seems to work fine now.

 

Bad news: 36x slows everything down to ca. 30 FPS again.

 

Worse news: getting EO1's dungeon models into this project will be more difficult than I thought, as I need to cram all their textures into one big texture, and I'm not sure how big a single texture can be on DC. Also, redo the model format, make a converter NSBMD to "Fr3Dv02", etc.

 

Worst news: with more than 36 models, I'm already running into vertex buffer limits. As I'm, as mentioned, still a PowerVR n00b, I am not sure what those limits are, what I can do against them, if there's a different, smaller vertex format I could use, if the limits are in some way variable, etc., etc.

 

0OASZBa.png

 

  • Like 1
Link to comment
Share on other sites

I'm starting to hate inaccurate emulation... or more like, I'm starting to hate the fact that modern systems do not have accurate emulators, as an alternative to HLE and other shortcuts.

 

The ca. 30 FPS I was getting apparently stemmed from me having nullDC's dynarec CPU core disabled, because I was (and probably still am) getting periodic emulator crashes when running my code using that core. The interpreter core works fine, but it's obviously pretty damn slow. Now, with the dynarec enabled, and when it decides not to crash, the code is reporting FPS fluctuating between exactly 58.82 and 62.50 - however, at the same time, the emulator's stats in the title bar report ~94-97% speed and VPS ("video frames per second"?) of 56 to 57! Ugh...

 

Starting to think I'll need to waste another CD-R sometime soon, after cleaning what I have code-wise up some more, re-adding the performance meter I've had in the C-based project (modified slightly from the one in the KOS examples), etc. If a hardware test shows steady 60 FPS with 36+ models being rendered, and maybe independently rotated and stuff for good measure, then I'll just live with the slow interpreter.

 

Still need to look into the vertex buffer stuff, tho. I will need to be able to render more and different models with varying vertex counts, otherwise this'll be somewhat pointless of a project... in fact, a floor in Etrian Odyssey 1 can be 35 by 30 tiles in size if I remember correctly - 1050 tiles, 1050 models wanting to be rendered! Of course, not all of them will need to be shown at once, having the code just render, say, 10 by 5 tiles ahead of the player (10 tiles straight ahead, with 2 more on each side) should be far more manageable.

 

Side note: to my surprise, the dynarec-using instance of nullDC I left running while I was typing this post up didn't end up crashing. ...those crashes are fucking random and it's annoying! Because I DID get a crash before I started writing this! <.<

 

Another side note: I'm still sick but I can't sleep, so it's 3:22 am and I'm sitting in front of my PC still with some fever. Fuck this cold or whatever the hell -.-

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.