Hacking Reggie! - NSMBWii Level Editor

Status
Not open for further replies.

Treeki

Well-Known Member
OP
Member
Joined
Aug 1, 2007
Messages
203
Trophies
0
Location
Rogueport
XP
255
Country
Gibraltar
creffca said:
After your C lib produces the rgbdata do you then iterate through that and setpixel () each pixel of the bitmap, or do you write directly to the bitmap's bits?
Nope, I'm using the QImage constructor which lets me create a bitmap directly from raw data.

Anyway, it's getting even better! I've added LZ decompression to the module. Now it's amazingly fast - 1-1 loads in less than 0.2 seconds. Larger levels like 6-1 take about half a second to load: tilesets are no longer the bottleneck; now it's the rest of the level loading code. Still, I don't really feel the need to optimise it - it's heavily linked with Qt (so it will be more of an issue in C) and it's fast enough now.

There are a few bugs in it (alpha still isn't parsed correctly, LZ is somewhat hosed so there are a bunch of missing pixels in some tilesets) but once I get those fixed it will be pretty awesome.
 

TempusC

Well-Known Member
Member
Joined
Nov 22, 2006
Messages
229
Trophies
0
Website
www.FatalFrame4.net
XP
91
Country
Canada
I must defend my OS and point out that regular Leopard does not have the issues I ran into, and also that Mac Reggie runs about as fast without psyco as his comparable desktop did with psyco, and generally smoother. Anyway, it turns out that the problem with the C module on my Mac had nothing to do with the C module, and was easily fixed.

But yeah, good luck trying to run the source version on Snow Leopard. Compile Qt and SIPfrom scratch for both architectures (do it twice to different locations and link them), and then compile PyQt using both architectures (just once is fine now) making sure to change the architecture argument in configure.py for the i386 to 64 bits. After that it works fine. Oh, but you'll need to compile a 32 bit version of python 2.6 as well if you want to run psyco. I'll make sure to release a packed .app.
 

Treeki

Well-Known Member
OP
Member
Joined
Aug 1, 2007
Messages
203
Trophies
0
Location
Rogueport
XP
255
Country
Gibraltar
TempusC said:
I must defend my OS and point out that regular Leopard does not have the issues I ran into, and also that Mac Reggie runs about as fast without psyco as his comparable desktop did with psyco, and generally smoother. Anyway, it turns out that the problem with the C module on my Mac had nothing to do with the C module, and was easily fixed.

But yeah, good luck trying to run the source version on Snow Leopard. Compile Qt and SIPfrom scratch for both architectures (do it twice to different locations and link them), and then compile PyQt using both architectures (just once is fine now) making sure to change the architecture argument in configure.py for the i386 to 64 bits. After that it works fine. Oh, but you'll need to compile a 32 bit version of python 2.6 as well if you want to run psyco. I'll make sure to release a packed .app.
Yeah, it turns out that it's just Snow Leopard screwing up things. The module seems to work now after removing the QImage => QPixmap conversion, although we haven't tested the finished version on Linux and OS X yet.

Still, it's quite nice now - the editor starts and loads 1-1 instantly on my system, and everything looks 100% accurate - reverting to the old methods if nsmblib isn't present. So nsmblib is pretty much complete, unless we find any further bugs in it!
 

Dteyn

Well-Known Member
Member
Joined
Aug 3, 2008
Messages
335
Trophies
0
XP
115
Country
Canada
Treeki said:
Still, it's quite nice now - the editor starts and loads 1-1 instantly on my system, and everything looks 100% accurate - reverting to the old methods if nsmblib isn't present. So nsmblib is pretty much complete, unless we find any further bugs in it!

Great job on working out the bugs. It's interesting to see the bits and pieces of code. I have experience coding but I've never touched Python, it's neat to see how flexible it really is. Keep up the great work, and I sure hope both your guys' Christmas is as nice to you as you have been to us in developing and perfecting Reggie! Also as a sidenote, I also tried to ring up Mr. Fils-Aimé himself and wish him a Merry Christmas, but he wasn't available for comment.
smileyshrug.gif
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
creffca said:
Treeki said:
...
I'm also working on recoding a few of the other algorithms (like LZ decompression) in C, which should make it run even faster. That was your update for today
biggrin.gif

LZ77 is notoriously slow to decompress. C should help a lot though.
I thought LZ was very fast to decompress, that's why Loopy used it for his nes emulator on gba (pocketnes) to decompress game's savestate on the fly as it doesn't need a lot of CPU and ram.
The one used by Loopy is LZSS, it doesn't work like LZ77 to decompress ? I didn't check the differences, I was just wondering.

But you manage to recode it nicely, so it's not a problem anymore. good job
wink.gif
 

TempusC

Well-Known Member
Member
Joined
Nov 22, 2006
Messages
229
Trophies
0
Website
www.FatalFrame4.net
XP
91
Country
Canada
He lies, I tested it. It works great. Just tonight I implemented the dynamic minimap (before we had a really awkward static one) with realtime drawing. No more gigantic wastes of space while struggling to fit a static sized minimap with only a few preset zooms into the interface. Now, the minimap shows the content in your level and only the content, and zooms to fit whatever space you've got it in. Before, it only redrew itself when you clicked it. Now, you can move objects in realtime and watch them move on the minimap.

Along with a few minor bugfixes, I also decided to add proper keyboard shortcuts.
 

Blue-K

No right of appeal.
Member
Joined
Jun 21, 2008
Messages
2,572
Trophies
0
Location
Helvetica
XP
209
Country
Swaziland
Looks like the Wii Homebrew/Hacking-Scene will get many Christmas Gifts this year
biggrin.gif
. And hell yeah for the final confirmation that this works on Ubuntu! Thank you for not letting the Linux-Users down!
 

Arisotura

rise of melonism
Member
Joined
Dec 5, 2009
Messages
839
Trophies
1
Age
30
Location
center of the Sun
Website
kuribo64.net
XP
2,498
Country
France
Treeki said:
Mega-Mario said:
QImage.setPixel must use the Windows API SetPixel() (atleast under Windows), which is slow indeed. You should rather consider putting all the pixels in a buffer, then render it as a bitmap, for each object.No, as far as I know, Qt implements its own software rendering engine.
Mega-Mario said:
I'd even recommend that you rewrite the whole editor in C++, if you feel like it... but it's your choice. Not forcing you.I've been thinking about it for a bit; although even if I did, I'd still use Qt. But I already have almost 5000 lines of Python code and I don't really want to have to rewrite all of it. The editor is fast enough in Python even on my netbook - it's just loading which is an issue, and I'm working on it.
QUOTE(TobiasAmaranth @ Dec 20 2009, 02:00 AM)
12 days left in the year~ Since sprites are all that's left, can we hear some of the stuff that's actively being worked on?
Soon
wink.gif
Well, if Qt has a sofware renderer, the slowness isn't surprising. If it used GDI, it'd be faster (GDI is hardware-accelerated). I think wxWidgets uses GDI, but it may not have an equivalent for that nice QGraphicsView control you use for drawing.
 

Treeki

Well-Known Member
OP
Member
Joined
Aug 1, 2007
Messages
203
Trophies
0
Location
Rogueport
XP
255
Country
Gibraltar
Mega-Mario said:
Well, if Qt has a sofware renderer, the slowness isn't surprising. If it used GDI, it'd be faster (GDI is hardware-accelerated). I think wxWidgets uses GDI, but it may not have an equivalent for that nice QGraphicsView control you use for drawing.
The speed isn't caused by Qt. It's caused by the huge amount of Python code I had to run through - possibly over a million runs of the inner loop. If I do all the processing in a compiled language, it's close to instant for me. Consider also that my old code was calling Qt through the PyQt bindings, not through the native C++ functions.

I knew Python would have some overhead, but I never expected it to be THIS bad. I'm happy with the current optimisations though - the editor runs great.

There's also a hardware-accelerated renderer I can use (I can switch GraphicsView into OpenGL mode with one line of code) but it doesn't provide a speed increase and it's caused problems for some Linux testers, so it's disabled by default.
 

TobiasAmaranth

Well-Known Member
Member
Joined
Feb 6, 2009
Messages
456
Trophies
1
Age
38
Location
Texas
Website
werewolfdarkarts.com
XP
2,624
Country
United States
Gah! So much techno-babble
tongue.gif
That does, however, make me wonder if I could commission a website coder for an old website of mine I've been meaning to upgrade via this site. It's difficult to find a reliable coder that charges independent/casual developer prices instead of commercial prices.
 

Motherbrainsbrai

Active Member
Newcomer
Joined
Nov 17, 2009
Messages
34
Trophies
0
Age
35
Website
Visit site
XP
88
Country
United States
TempusC said:
I must defend my OS and point out that regular Leopard does not have the issues I ran into, and also that Mac Reggie runs about as fast without psyco as his comparable desktop did with psyco, and generally smoother. Anyway, it turns out that the problem with the C module on my Mac had nothing to do with the C module, and was easily fixed.

But yeah, good luck trying to run the source version on Snow Leopard. Compile Qt and SIPfrom scratch for both architectures (do it twice to different locations and link them), and then compile PyQt using both architectures (just once is fine now) making sure to change the architecture argument in configure.py for the i386 to 64 bits. After that it works fine. Oh, but you'll need to compile a 32 bit version of python 2.6 as well if you want to run psyco. I'll make sure to release a packed .app.

this is good to know, i planned on using reggie on osx and im glad to hear it's up and running smoothly. thanks for the update
 

jmlsteele

Member
Newcomer
Joined
Dec 21, 2009
Messages
7
Trophies
0
XP
9
Country
Canada
I am SO pumped to play around with this. In all honesty something like this should either just have come with NSMBW, OR they should release downloadable level packs via WiiWare. I would buy those in a second!
 

Treeki

Well-Known Member
OP
Member
Joined
Aug 1, 2007
Messages
203
Trophies
0
Location
Rogueport
XP
255
Country
Gibraltar
Here's an update for today!

We've been working all day on making Reggie better. New stuff so far:

- There's now a feature that takes a snapshot of a specific part of a level and saves it as an image.
- The dynamically scaling minimap (like Tempus mentioned) is finished and fully functional.
- Copy/paste has been added - however, it doesn't work across several open Reggie instances, the clipboard is specific to the level you have open. You also can't copy entrances/exits.
- I've made various interface improvements (for example, when you place the mouse over an object or sprite, the position/size/type of it will now be shown in the status bar).

No new screenshots since there isn't really much that can be shown in an image though.
 

kyoko_sayuri

Well-Known Member
Newcomer
Joined
Dec 10, 2009
Messages
61
Trophies
0
Age
35
Website
Visit site
XP
42
Country
Brazil
Treeki said:
Here's an update for today!

We've been working all day on making Reggie better. New stuff so far:

- There's now a feature that takes a snapshot of a specific part of a level and saves it as an image.
- The dynamically scaling minimap (like Tempus mentioned) is finished and fully functional.
- Copy/paste has been added - however, it doesn't work across several open Reggie instances, the clipboard is specific to the level you have open. You also can't copy entrances/exits.
- I've made various interface improvements (for example, when you place the mouse over an object or sprite, the position/size/type of it will now be shown in the status bar).

No new screenshots since there isn't really much that can be shown in an image though.

Hi Treeki,
You could not make a video showing some features of Reggie?
Thank you for reporting the updates, this is really an incredible job!
 

nitrostemp

Well-Known Member
Member
Joined
Mar 15, 2009
Messages
1,563
Trophies
0
Age
33
XP
1,469
Country
just a simple screen capture using the program to make modifications would be awesome, when ever you can
 

Treeki

Well-Known Member
OP
Member
Joined
Aug 1, 2007
Messages
203
Trophies
0
Location
Rogueport
XP
255
Country
Gibraltar
kyoko_sayuri said:
Hi Treeki,
You could not make a video showing some features of Reggie?
Thank you for reporting the updates, this is really an incredible job!I'll look into it - I had made one a while ago, but it's outdated and doesn't really reflect the current version of Reggie. If I can get some time I'll make a new one.

QUOTE(nitrostemp @ Dec 22 2009, 06:15 AM) just a simple screen capture using the program to make modifications would be awesome, when ever you can
I've posted quite a lot of these in the thread already - the reason I didn't post any today is because there aren't really any visible improvements, other than the new minimap.
 

kyoko_sayuri

Well-Known Member
Newcomer
Joined
Dec 10, 2009
Messages
61
Trophies
0
Age
35
Website
Visit site
XP
42
Country
Brazil
Well, I hope you use your free time to continue with the updates and let the video into the background ... ;-)
(Reggie will be a powerful editor, sure!)

______________________________________________
My new signature is:
75832426.png
 

mooseknuckle2000

Well-Known Member
Member
Joined
Apr 7, 2009
Messages
284
Trophies
0
XP
175
Country
United States
Treeki said:
Here's an update for today!

We've been working all day on making Reggie better. New stuff so far:

- There's now a feature that takes a snapshot of a specific part of a level and saves it as an image.
- The dynamically scaling minimap (like Tempus mentioned) is finished and fully functional.
- Copy/paste has been added - however, it doesn't work across several open Reggie instances, the clipboard is specific to the level you have open. You also can't copy entrances/exits.
- I've made various interface improvements (for example, when you place the mouse over an object or sprite, the position/size/type of it will now be shown in the status bar).

No new screenshots since there isn't really much that can be shown in an image though.
sweet! That's gotta make it like 98% complete now right?
wink.gif
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @K3Nv2, Lol K3N1.