2xwargus: Warcraft 2 Engine Re-implementation


I haven't noticed any screen flicker yet.

A little thing to report - the app crashed on loading a saved game.

Re: Installation, perhaps the best way is a pre-compiled pack delivered via the protocol-that-must-not-be-mentioned. I'm sure a fan could put that together in good time. ;)

Re: Sound. Do you mean that if the wavs were batch converted to a lower bitrate/file size, it might be viable? If so I'll look into a good app to do the job.
 
I remember seeing screen flickering on the first few times I played with it, but lately (after adding the mmuhack) I don't think so. I just finished an entire scenario (Human Campaign #13), which took me a couple of hours (with some minor slowdowns from time to time when there were a lot of units around), and I don't remember seeing flicker. I could just be imagining things though. :p

Here are some other things I noticed:

- Settings, Logs, and Saved Games are being stored in the NAND.

- Command line parameters do not work; scrolling is too fast and hard to control.

- Command keys (letters on the command tiles) are misaligned, and should be disabled by default as they are useless for the GP2X.

- Fog of war is not transparent.

- Wasteland and some of the Swamp tilesets are not transparent as the output from ImageMagick do not contain a white background with transparencies.


Request, for Keymap 0, map button R also for "Hold for Scrolling" like button L.

Is there a way to quickly move the cursor to the command tiles? It would be like a toggle to jump the cursor to command tiles, then jump back to the center of the screen.

Great work, and thank you for this. :)

EDIT 1:
Gruso said:
A little thing to report - the app crashed on loading a saved game.
I was able to load a couple of saves (3 of them), but one save won't load and get stuck in the process.


EDIT 2:
I was able to fix the nontransparent tilesets by manually editing them to add transparency.
 
Last edited by a moderator:
Adventus said:
I did initially program the MMUhack in, but found no performance improvement. So if you want to give it a try, any MMU hack file will work, just place it in the folder with 2xWargus224.gpe.
I thought the module took care of it. All i you really have to do is load the module after youve setup SDL/screen and then unload before the program exits. But if youve figured how to get wargus to work like you have im sure you used the module correctly.
 
Last edited by a moderator:
@Manjuu Thanks for your input (and others). With your comments I've bugfixed the release, you can get if here (or from the first post):

http://host-a.net/Adventus/2xWargus_PB1.1.zip

Note:
- Fixed Command Line arguments
- Fixed Home directory, no longer on NAND, Should also fix the save game inconsistencies.
- Defaults to not showing command keys
- This does not require you to reconvert your "data" folder, just copy the .gpe.
- To use your old saves move them from your NAND to "./home/wc2/save/".... this folder will be made when you start wargus.

QUOTE
I remember seeing screen flickering on the first few times I played with it, but lately (after adding the mmuhack) I don't think so.
Yea It only seems to occur when its running fast, like at the very beginning of a game. Probably something getting out of sync.

QUOTE
- Fog of war is not transparent.
You can make it transparent if you like. Goto "scripts/stratagus.lua" and change "SetFogOfWarOpacity" to 128. However, It does incur a nasty performance hit.

QUOTE
- Wasteland and some of the Swamp tilesets are not transparent as the output from ImageMagick do not contain a white background with transparencies.
Aslong as its palletised, then a colorkey should be applied. Default: rgb(252,252,252). So the fact there isn't transpariencies within the actual png shouldn't matter much. Unless i've screwed something.... ingame is the white bits visible? I made it this way, because all the batch programs kept on losing the alpha colorkeys (grrrr).

QUOTE
I thought the module took care of it. All i you really have to do is load the module after youve setup SDL/screen and then unload before the program exits. But if youve figured how to get wargus to work like you have im sure you used the module correctly.
Yea, Im pretty sure I'm applying it correct.... And I'm not surprised it doesn't give a speed boost.

As far as i know, It only gives a speed boost when the CPU is writing or reading multiple times from the same address. It buffers these actions. The only time the CPU touches the upper mem is during loading (which is only a single write per address in most case), the hardware blitter does all the uppermem rendering.
 
i used to play this game a lot

and i cannot find where i put it (i dont even remember what was the year last time i played with it)

of course, every copy online is a battle.net one :(
 
Thanks for the update. :)

Scrolling is much better now; thanks to the working command lines.

It still saves in the NAND. The preferences.lua & game saves are now properly saved in the SD card, but the logs are still being saved in the NAND. <_<

It seems that the cursor speed is a bit too fast on some screens now. (i.e. Main Title screen and Campaign Act screen)

Hmm... there are still some free buttons on the Keymaps, I wonder if they could be used for some of the commands, like Attack and Stop, or preferably a toggle to jump between the command tiles and the center of the screen.

Adventus said:
QUOTE
- Wasteland and some of the Swamp tilesets are not transparent as the output from ImageMagick do not contain a white background with transparencies.
Aslong as its palletised, then a colorkey should be applied. Default: rgb(252,252,252). So the fact there isn't transpariencies within the actual png shouldn't matter much. Unless i've screwed something.... ingame is the white bits visible? I made it this way, because all the batch programs kept on losing the alpha colorkeys (grrrr).

The problem is that the output is not white. :(

2xwargus02qw4.png
giantturtlelw2.png


If I manually edit them to add transparencies, then they would appear correctly.
EDIT: I think it would be better to remove the ".gpe" in the main file, and rename the script with the ".gpu" to ".gpe" (and edit the exec target in it). This would make it less confusing on which to launch. ;)

Another thing, I figured out why the one save that I have that gets stuck while loading; it was a corrupted save file... I tested it in the Windows version and causes the program to crash. <_<
 
Last edited by a moderator:
PlopperZ said:
jose said:
hello, please can anyone tell if it runs on F100? thanks. joe
Yes it does

How good are the controlls on F100 (without Touchscreen) ?

And how complicated is it to install the Game onto the GP2X? It was written here that it's not easy :ph34r:
 
Last edited by a moderator:
Adventus said:
QUOTE
of course, every copy online is a battle.net one
*Cough* WAR2_122.exe *Cough* :)
thanks man :lol:

gonna try it later
 
Last edited by a moderator:
fusion_power said:
How good are the controlls on F100 (without Touchscreen) ?

And how complicated is it to install the Game onto the GP2X? It was written here that it's not easy :ph34r:

It's easy really. In a nutshell:

- install Wargus on your PC
- install an image converting tool
- make a copy of Wargus data folders
- run a batch file to convert the images
- put the newly prepared files + .gpe etc into a folder onto your SD card.

It's not complicated, there are just a few steps involved. Much easier than getting Albion working imo.

As for the controls, I'm on an F200 but I haven't actually used the touchscreen for gameplay yet. It's as simple as moving the mouse cursor with the d-pad, and using X/B for left/right click. It's very well done.

Get on it. :)
ps Thanks for the update Adventus, will try out today if I get a chance.
 
Last edited by a moderator:
@Pickle & fusion_power Although i've only tested on an F200, i would assume (and the other users seem to agree) it works on F100 aswell.

QUOTE
It still saves in the NAND. The preferences.lua & game saves are now properly saved in the SD card, but the logs are still being saved in the NAND.
Ahhh man. I'm on an F200 and i cant seem to access my NAND, so it twas a bit hard trying to find out which directories i needed to change. Anyway i've fixed it in my release (I hope).

QUOTE
It seems that the cursor speed is a bit too fast on some screens now. (i.e. Main Title screen and Campaign Act screen)
Ya, thats because its running at a high fps in those menu and the cursor movement is not being delta timed. Will be fixed in next release.

QUOTE
Hmm... there are still some free buttons on the Keymaps, I wonder if they could be used for some of the commands, like Attack and Stop, or preferably a toggle to jump between the command tiles and the center of the screen.
hmmm Ok, for keymap 0 how about this, i'll map vol + and vol - to cycle through the the bottom left commands. Pressing A will select the command which the vol buttons has selected, Y will do an esc (return to previous command menu). It might be a little tricky to program because of the prgramming structure its using, aka stratagus engine + Wargus lua scripting.

QUOTE
The problem is that the output is not white.
Hmmm they are with my warcraft 2, you must have a different version. It'll be a bit hard to determine which colorkey to use, i think manual modifying is probably the best for now.

QUOTE
EDIT: I think it would be better to remove the ".gpe" in the main file, and rename the script with the ".gpu" to ".gpe" (and edit the exec target in it). This would make it less confusing on which to launch.
I thought it was pretty standard in gp2x programs that a .gpu is a script and a .gpe is a binary. I dont think i'll change it for now.

Cheers, keep up the good suggestions.
 
Hey Adventus, the Developer Fund thread got me thinking. I'm a coding know-nothing, and I'm curious about the amount of work that this release needed. What sort of steps did you have to take, and what sort of time went into it? You can get technical, I'm not scared. Please describe using diagrams where necessary.
 
Adventus said:
QUOTE
It still saves in the NAND. The preferences.lua & game saves are now properly saved in the SD card, but the logs are still being saved in the NAND.
Ahhh man. I'm on an F200 and i cant seem to access my NAND, so it twas a bit hard trying to find out which directories i needed to change. Anyway i've fixed it in my release (I hope).

I also have a F-200... :lol:

I use Filer2x to browse the NAND. It's a Japanese app, but you can switch to English with the button R, and hold Vol+ to read the help info. There also seems to be no exit menu in it, so you either need to reboot or launch a program in it. (It's also a launcher.)

Currently, "wc2" folder is being created with the logs in them.

Adventus said:
QUOTE
Hmm... there are still some free buttons on the Keymaps, I wonder if they could be used for some of the commands, like Attack and Stop, or preferably a toggle to jump between the command tiles and the center of the screen.
hmmm Ok, for keymap 0 how about this, i'll map vol + and vol - to cycle through the the bottom left commands. Pressing A will select the command which the vol buttons has selected, Y will do an esc (return to previous command menu). It might be a little tricky to program because of the prgramming structure its using, aka stratagus engine + Wargus lua scripting.

Sounds nice. :)

Although, they are just suggestions... if it's too much trouble or would incur a noticeable performance penalty, then you don't really have to. The controls are very usable as they are.

Adventus said:
QUOTE
The problem is that the output is not white.
Hmmm they are with my warcraft 2, you must have a different version. It'll be a bit hard to determine which colorkey to use, i think manual modifying is probably the best for now.

I figured it would be something like that. I did try with different sources, ImageMagick still outputting some of images like that. Oh well, must be something to do with my system, ImageMagick, or the source image files. I can manually edit them, so no worries.

Adventus said:
QUOTE
EDIT: I think it would be better to remove the ".gpe" in the main file, and rename the script with the ".gpu" to ".gpe" (and edit the exec target in it). This would make it less confusing on which to launch.
I thought it was pretty standard in gp2x programs that a .gpu is a script and a .gpe is a binary. I dont think i'll change it for now.

I don't know the "standards", but from what I understand ".gpu" is used for utilities and non-game programs, which also can include scripts, while ".gpe" is for games and emulators. From what I observe with other homebrew, the launching scripts for games ends with ".gpe", while ".gpu" for utilities.

I mentioned this is because you could remove the "gpe" of the main file, so that the gp2xmenu won't see it, and it would be much simpler, cleaner, and less confusing. Plus, there is little reason to launch that one instead of the script that contains the command line settings.

In the end, it really just comes down to preferences. You don't have to do anything, I can always manually edit it to my liking. :p
 
Last edited by a moderator:
QUOTE
Hey Adventus, the Developer Fund thread got me thinking. I'm a coding know-nothing, and I'm curious about the amount of work that this release needed. What sort of steps did you have to take, and what sort of time went into it? You can get technical, I'm not scared. Please describe using diagrams where necessary.
Hmmm, thats a difficult question. Some factors should be taken into consideration, I'm probably not indicative of the average dev round 'ere. I've seen daylight.... haha :)

I'm rather new to programming (going on ~2 years now, one year with a real programming language), i've never been formally taught, never read a programming book. So everytime i do something its a learning process. However many ideas i'm developing in my uni degrees (theoretical physics & mechatronic engineering) probably help.

Getting things to cross-compile can be very hard for a newbie. Makefiles can be written in several different ways, and they often, understandably, try to do things (like automatically detect OS, good settings and processor arch) that make it easier for people who are natively compiling..... which naturally you have to bypass without too much harm done.

If I 100% knew what i was doing (ie familar with: particular engine, compiling process, used libraries, programming language), I could finish a port very quickly.... the actual amount of written code can vary greatly. In this case it was fairly minimal. I would say 90% of my time is either searching through the engines header files trying to locate a variable/function that'll give me a clue, or looking through library documentation.

Another thing, I can tell you that stratagus is quite possibly some of the nastiest code (not that i can talk :)) i've seen on a large scale. At some point i think it moved from C to C++, as well as incorporating a generic GUI engine (guichan) and "tolua" engine (17,000 lines of computer generated vomit.... in one file). I much prefer uHexen2.

Since i usually do it in small chunks over a long period, heres what i remember of the wargus build:
  • 1. Cross compile Lua for ARM. I tried a few different versions including a fixed point hack. This was fairly easy, but required a little bit of Makefile hacking since I'm compiling from x86 windows -> ARM Linux.
  • 2. I successfully cross compiled a version of wargus that was released for QVGA mobile phones.... it also came with a rescaled texture pack, OMG ILLEGAL.... so it was instantly playable.
  • 3. I wrote a generic input system that integrated well within the engine. Basically it simulates an SDL event when a button is pressed..... and therefore is completely isolated from the internal systems.
  • 4. Played the game a bit. Realised this was an old version of wargus that was fairly basic on the AI front and was very slow.... nearly thought it wasnt worth going on.
  • 5. After toiling with my conscience, decided to do my own port of stratagus & wargus. Downloaded SVN build of stratagus and most recent wargus. Moved my input system in, made some minor adjustments. Got it to cross compile successfully.
  • 6. Decided it would be awesome, without the underlying engine realising, if i mapped its 640x480 coordinated space to 320x240 like you can with 3d games.
  • 7. Played it at a 640x480 res..... ungodly slow. Decided that maybe the hardware blitter would be a good investment. Spent a fair bit of time trying to convert the png loading code so that it worked with SDL hardware surfaces. Eventually discovered that i had to make font sprites nonhardware because the cpu keeps on accessing them (changes their colors, etc).
  • 8. Eventually got hardware blitting working.... still ungodly slow at 640x480. Sweet. Decided my only plan of attack was to dump my 640x480 plan and bite the bullet, 320x240 native was my only choice. This meant i would have to redesign the UI... in Lua (a language i've not before encountered).
  • 9. Discovered Lua is quite possibly the easiest language in the world. Spent a lot of time going through Lua files dividing everything by 2 (sprite dimensions, bounding boxs, positions, etc).... Lots of Fun. Also because the fonts look shitehouse when scaled down, i provide one.... which replaces the 5 warcraft comes with (mostly). This means that dividing by two isnt correct in many cases, i had to fit it to the new font.
  • 10. T'was happy with the speed when rendering 320x240 with hardware blitter. Finally had a decent warcraft II in my pocket. Unfortunately sharing it with others was a bit of a problem, i needed an easy, multi-platform way of half sizing the textures extracted from Wargus (i was just using a script in PaintShop Pro XI).
  • 11. Tried a few batch image resizing programs. They all seemed to lose my pngs color keys no matter the settings (and i tried many). Settled on ImageMajick, seemed fast & well documented. Hacked a default color key into stratagus that is used for any palletised image.
  • 12. Wrote help file, and generally cleaned up some stuff. Released Public Beta 1.
Over this whole dev process it probably took about 2 months ON and OFF, but as i said before ask me to do it again and it'll take less than a day. As you can see alot of time was wasted. [/wall-o-text]

Edit: Replying to Manjuu....
QUOTE
I use Filer2x to browse the NAND. It's a Japanese app, but you can switch to English with the button R, and hold Vol+ to read the help info. There also seems to be no exit menu in it, so you either need to reboot or launch a program in it. (It's also a launcher.)
Yea, i tried using Enexfi, but i couldn't work it. Anyway, if its only the "logs" folder then i've already fixed it.

QUOTE
Although, they are just suggestions... if it's too much trouble or would incur a noticeable performance penalty, then you don't really have to. The controls are very usable as they are.
Don't worry, i've already done it. Every button is now mapped to something, and it works really well, you have to be pretty coordinated though.

QUOTE
I don't know the "standards", but from what I understand ".gpu" is used for utilities and non-game programs, which also can include scripts, while ".gpe" is for games and emulators. From what I observe with other homebrew, the launching scripts for games ends with ".gpe", while ".gpu" for utilities.
*Suddenly the "u" makes sense* Ahhh, mmkay, will be done in next release.
 
hello,

here: i encountered crash.
.
.
Can't load the sound `ui/highclick.wav'
Can't load the sound `ui/statsthump.wav'
rmmod: mmuhack: No such file or directory
insmod: mmuhack.o: no module by that name found
MMUhack NOT Successfully Initialised
Can't load the sound `campaigns/human/level01h-intro1.wav'
rmmod: mmuhack: No such file or directory
Fatal signal: Floating Point Exception (SDL Parachute Deployed)

dunno if the log is somewhat useful. regards,

joe
 
it worked out like a charm :)

some minor notes

-the screen scroll is too fast, it gets a little anoying trying to get to the exact spot you want

-when yo play the game and exit, a mouse arrow get stuck on the left upper corner on many of the other aplications i launched after warcraft

great work man, if you can add sound to this, i think its gonna be on the top 3 ported games for the gp2x, i mean it
 
Back
Top