(shouting)

Anyone want to test an SMBX extension module?

wanna make a game, or anything else? seminal bloom!
kil3
Posts: 0
Joined: 13 years ago

Anyone want to test an SMBX extension module?

Post by kil3 »

Really need 1 person with windows 8 and 1 with vista to tell me if it crashes, read on

I've created an asmbxt.exe with a modified dll import table and added a call to the new DLL from the main frame loop of the game which will allow for running of arbitrary C code once per frame. The possibilities are limitless here, but some immediately helpful ones would be

- Infallible hub filter. It'd be trivial to add something to the frame code like If level == hub, player's PowerupState = no powerup and player's mount (counts for shoes and yoshis) = none. You could get more complicated than that with only removing certain powerups.

- A death counter that isn't really bad

- Per-level stuff, like LevelASM from SMW. But since it hasn't been tested to work on a lot of systems yet, probably not a good idea atm

- Since it's a DLL separate from the program, no ASM hacks have to be written and patched in constantly. You can write powerful C code, push F6 in the compiler, drop the DLL in the folder and call it a day

- Since it's not a parent launcher / debugger like the death counter was, there shouldn't be any issues with different versions of windows. It's in the DLL import table right there next to the VBA runtime, so it's connected right into the game in a very meaty way.

- Unlike the death counter, it is not a separate process or anything, so it can't cause any slowdown, and you don't have to worry about closing it. It's just an easily-replaceable block of code that smbx can call.

Here's a demonstration of some basic code which I have disabling the NPCs every 200 frames

http://www.youtube.com/watch?v=oT-B6VN8 ... Aw&index=1

To test it, take this link http://www.gamearchaeology.com/smbxextender.zip, put the exe and dll in the folder your original.exe would be /is in and run asmbxtEXT.exe. The frame code should run in both the editor or main game.

What should happen: Same as the video, NPCs stop updating themselves once in awhile, and maybe some other weird effects as a side effect of how crude the demonstration code is
What shouldn't happen: Game not opening, game crashing, or other issues. Hoping this doesn't happen because then I'll have to pretty much abandon this idea.

Oh yeah, I need to know if it works on various versions of Windows mainly. Vista, 7, 8, x64 builds, whatever.
Last edited by kil3 11 years ago, edited 1 time in total.
User avatar
Validon98
Echoing Birdsong
Posts: 391
Joined: 11 years ago
Pronouns: they/them
Location: The Great Youkai Forest

Re: Anyone want to test an SMBX extension module?

Post by Validon98 »

Okay, I just tested this. I'm on a Japanese locale Windows 7 Professional 64-bit operating system, and all NPCs stopped every 200 frames, as expected. Effects seem to not play during this period, and events are completely frozen (such as the event that stops you from moving after hitting the ladder blocks in the hub. Why does that event exist, by the way?). Also, the Blooper in the pool in the front stops moving completely, but I don't know if it's a glitch or not.
Also, how would you program new modules for this thing? Because yeah, it's great this stuff exists, but I sort of don't know how I would make something with this.
Also, I wasn't expecting a creepy Demo to be staring at me when I opened the .exe. Not funny. >.>
Because Touhou OCs can in fact exist, sounds fake I know.

I can't change my username but I go by Vali/Claire now (aka call me Vali or Claire at your leisure ^^).

I never update this currently playing section anymore, it's probably an RPG or something.

Strawberry Bose Partial Translations and Patches!
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

OK, that's nice to know. That's one down.

About doing custom add ons, honestly I'm not sure. Due to C++ compilers being gigantic pains, (I think) anyone who wanted to compile the .dll would have to have the same version of microsoft visual studio 2010 as me, because that's the output the .exe expects. Also you'd have to know C at least. It'd probably be easiest if people just told me what they wanted and I'd do it for them.
User avatar
Trotim
Posts: 13
Joined: 14 years ago
Location: Germany

Re: Anyone want to test an SMBX extension module?

Post by Trotim »

This has amazing potential I'm sure

Instead of asking for gimmicks I'd really just like to see a death counter, and later a time limit. Just these things the engine is missing. Any feasible way of simulating multiple midpoints?
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Since the midpoint system is heavily baked into the level format probably not. This mainly manipulates stuff at runtime, but who knows. I have to look into the way midpoints work more. A timer and death counter would be pretty easy once I look into the hud drawing routines a bit more.

By the way could you try running it and seeing it crashes? I still need a lot more testers to see if it's going to work on all systems, especially vista and windows 8 testers at the moment.

Also if redigit was sane, he used function pointers for sprite behavior functions, so someone could write their own sprite behavior routines if they wished.
User avatar
Sturg
Gets his freak on with VGM
Posts: 709
Joined: 13 years ago
First name: sturgyman
Location: - :noiƚɒɔo⅃
Contact:

Re: Anyone want to test an SMBX extension module?

Post by Sturg »

Got a tester here, and I'm running on Windows XP 2002 with a 32 bit operating system. Sorry that's not a particular OS you're looking for. But I'm just trying to help.

Here's some notes I took:
-Er, is it supposed to upload a picture of Demo through Microsoft Office Picture Manager? Or is it supposed to show up in the splash screen/start-up screen?
-For the most part, enemies work fine. They stop after time, and continuously do so.
-Though, if you start the level at a certain time, like when the game is supposed to freeze, a lot of enemies won't spawn and will just disappear. That is, until I run away, and then re-spawn them. This happens with any regular ol' NPC as well. Although Piranha plants seem to be immune to this flaw for some reason.
-Animated Backgrounds freeze with everything else
-One thing that is screwy is any power-up that messes with time, like the clocks and the green P-switch.
-Activating one of these power-ups during 'non-freeze' time will play the SMW P-Switch music, but it will not act like a regular P-Switch nor does it stop time. It just continues to freeze and unfreeze as usual.
-Activating one of these power-ups during 'freeze' time will play the SMB3 switch theme and freeze, but it will then continue going back and forth, stop 'n go. So basically it has no true affect
-Sometimes these power-ups will cause Demo (or the game) to freeze up for a sec, then return to normal. This happens when a time freeze from a power-up (or P-Switch) is ending and transitioning back to the music for the level.
-Activating a SMW P-switch still works. However, it extends the time for the p-switch since it freezes while the switch music does not. Because of this, the music for a switch ends much earlier than the actual event. After the switch music ends, it's silent until the actual switch event ends and returns to the normal music.
-Activating a clock while in p-switch mode will cancel the P-switch event altogether and yet have the same music glitch problem as mentioned before.
tl;dr It works for me, but there are some bugs in general with it.
ImageImage
Image ImageImage
RIP FISH NIPPLE BANNER
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

k thanks. That code really isn't supposed to work flawlessly, it's just there so that people can make sure the thing is working and the code is being run.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

http://www.gamearchaeology.com/source.zip

There's not a whole lot that can be done right now though because imagine trying to do anything meaningful in SMW with a RAM map that has 2 entries on it. If it turns out there's no unknown problems with vista and win8 I can start taking this more seriously and make a framework and some examples.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Yes the game is VB so the code has like 500 bounds checks and other bloat for every line that actually does something

Image
That's what 90% of the game looks like. 18 out of 35 instructions have nothing to do with the actual purpose of the program
User avatar
raekuul
2 Nephi 2:25-27
Posts: 1841
Joined: 14 years ago
First name: Pokota
Pronouns: he/him/his
Location: Deti Plains
Contact:

Re: Anyone want to test an SMBX extension module?

Post by raekuul »

And NOW we understand why it's broken when it comes to mp3 codecs.
Games Beaten In 2020, 2021, 2022, 2023, 2024
Image
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

It's funny you should mention that, because I'm completely unable to open smbx in ollydbg without sound disabled. Smbx tries to start 900 sound threads or something for each object it's loading and ollydbg has a fit. However this game handles sound, it's really bad.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: Anyone want to test an SMBX extension module?

Post by docopoper »

Ooooh. I want this so much.

If you can get this working I will be so happy. Some of the new features you could make with this would be amazing if you take account for the fact that I've decoded the lvl format. If you're able to figure out the name of the currently loaded level and interpret a specific file for each level then I could make an editor to let you generate those files.

I'm just imagining things like actual trigger zones and layers that move in more complex ways.

If you can't tell - I'm pretty excited about this since I had my hopes of creating insanely complex levels dashed when I discovered the 99 event limit (I wanted to create tools to move layers along splines and that sort of thing, and instead only made a copy paste tool that looks kind of bad due to the amount of hard coded stuff in SMBX). So if this thing can make that a possibility I'll be so happy.

Also - it works for me on Windows 7, 64 bit. Assuming that the effects are supposed to be like the time freeze clock on and off every few seconds.
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

I know you're interested in layer movement and stuff, and from what I've seen, the problems we've had lie in the way the game treats everything as one level in a gigantic area between -1 and +1. For instance sprites in the top left part of Section 1 have their position stored as double precision floating point coords near -1. Stuff in section 21 actually exists in the exact same space, and sprites in the bottom right of section 21 have their position stored as double precision floating point coords nearly equal to +1.

The problem is there is no snapping to even a basic grid when layers move, so very small imprecisions in double precision floating point operations eventually lead to your layers going out of whack (0 + 1 for 4 seconds roughly equals 4, but 4 - 4 for 1 second does not take you back where you started due to imprecision) which is exacerbated by the game treating the level as one gigantic area. I haven't looked much into the layer update function (but I know where it is) but it might be possible to get more precision if you control the layers through the framecode rather than the event system.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

that would be pretty hilarious and make things a lot easier for everyone
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: Anyone want to test an SMBX extension module?

Post by docopoper »

kil3 wrote:I know you're interested in layer movement and stuff, and from what I've seen, the problems we've had lie in the way the game treats everything as one level in a gigantic area between -1 and +1. For instance sprites in the top left part of Section 1 have their position stored as double precision floating point coords near -1. Stuff in section 21 actually exists in the exact same space, and sprites in the bottom right of section 21 have their position stored as double precision floating point coords nearly equal to +1.
Really? That's odd since it's totally different from the coordinates stored in the lvl format. Here is a quote from my specification:

"Where instances may be in different sections of the level – there is no stored variable to indicate this. Instead – the coordinates are simply shifted by 20000 each section, so section 1 starts at (-200000,-200000) and section 2 starts at (-180000,-180000). It is actually possible to move the view to another section in the editor."
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Yeah that's what I mean. But when the calculations for moving the layers take place it treats everything as 8 byte floating points and uses FPU instructions, and if the layers move through the event system (which is based on time / seconds) small imprecisions eventually throw the layers out of whack. Anyway I haven't really experimented with that a whole lot yet, so I'm not 100% on it.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: Anyone want to test an SMBX extension module?

Post by docopoper »

Well, hopefully there is a way to set the position instead of adding to it... Because that one fact has caused me so many problems. Making Pebble's Peaks was really frustrating.

Code: Select all

//+0xF0		w	= Player identity index (1 = demo, 2 = iris, 3 = princess, 5 = sheath)
Hehe. Poor Kood.
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

If my theory is correct then it might be hard to move layers around, but I'll check it out. And I don't know anyone named Kood...
User avatar
Holy
Posts: 133
Joined: 12 years ago

Re: Anyone want to test an SMBX extension module?

Post by Holy »

Windows 8 64-bit, the code seemed to work.

Some stuff:

--In the backwards 1-1 level, it appears that when you take the leek when everything's stopped and then re-enter the level, the flagpole at the beginning's gone! After testing a bit more it occurs to me that while this only seemed to happen when I took a frozen leek, it may be simply randomly disappearing like other things seem to do. Interactive background objects?

--In my pacifist level, the leek at the end wasn't there.

--Some enemies that should have died reappear, and my guess is if they don't actually disappear onscreen (you just step on them and run away before they can update) they dont count as dead.

--Events get janky, like when you meet the blood god and you're sposed to kneel, you dont and walk right off the side. The text that's supposed to come up still does though!

--I couldn't get the bridge leading to the second half of world one to break like it normally does half the time.

--If you wait for everything to stop, throw a shell, and go stand in front of it you dont get hit.

--Some of the signs in the hub seemed to be randomly missing at times.

So essentially randomly disappearing stuff!
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Yeah I don't think anything spawns when NPC disable flag is set (probably why no one should ever try using it in that way without special care).
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Also docopoper where is your level format documentation thingy, that might be helpful
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: Anyone want to test an SMBX extension module?

Post by docopoper »

https://dl.dropboxusercontent.com/u/490 ... Format.rtf

I'm really curious as to what can be done with this thing. I mean, even the ability to add trigger zones would be amazing.

Ideally I think a more advanced version of the events system would add a lot to this game. That's why I was imagining making an editor and you're dll reading a specific file for each level to act upon the advanced events set.

I hope I'm not imagining things that would be insanely difficult to do. :P It depends on how easy everything is to access for you.
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

You can already probably do trigger zones, but you would have to build the entire system up from scratch because there's no framework right now. Problem right now is that you would be hardcoding a lot of stuff. First you would hardcode that this code only works on a certain level and when demo is on a certain section, then you would figure out if demo was in the trigger zone through a series of if statements, and then if all of that was fulfilled you would do something... but right now there isn't a whole lot to trigger because not a lot of the game memory locations are known. All I really know right now are the locations of the player array and one of the layer arrays that controls the directional state of the layer and the layer name.

You probably can't access text files in the level folders right now because the function only runs during gameplay frames. Trying to read a text file on the first frame of the level might not turn out too well. What you'd want is another hook that runs during level load, but I barely know anything about that function and figuring it out would take about as much work as it took to set up the frame hook.

I figured out where some of the layer command data lies though http://www.youtube.com/watch?v=KFEJg0NY7MM
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: Anyone want to test an SMBX extension module?

Post by docopoper »

Oooh, now that is really cool. I can imagine a lot of cool things coming from non event driven layer control.

In your source you had placeholders for running code only on specific levels. So, why can't you just use that to detect when the level changes to load the file?
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
kil3
Posts: 0
Joined: 13 years ago

Re: Anyone want to test an SMBX extension module?

Post by kil3 »

Yeah that is basically how you would do it with what we have now, but like I said that code only runs after the level is loaded and it's just about to start doing collision tests and updating the position of everything on screen. So the absolute earliest time you could read that file is just as frame 1 is about to be processed. I mean it might work, but it's just worrisome that you'd be doing a lot of file I/O operations right there in the middle of the frame code when ideally there should just be another hook in the level loading code specifically for stuff we want to do there.

But the only thing I was really planning to do with this for now was make a hub filter so there wouldn't be filter drama in th enext game, and a death counter which appear on screen and works, so yeah... all of that is kind of a lot of work I wasn't really planing on doing anytime soon. :D
Post Reply