PDA

View Full Version : As Yet Unnamed Entry - RTS against 'the empire'



code_glitch
11-04-2012, 05:34 PM
Thats right folks, I'll be in this one - and its a bit cliche and a bit ambitious... Something like this:

You and your followers know the truth behind some scandal and disagree with a world power of some sort. Your job, is to take them on and win to restore global peace. Think Advance wars with an RTS element here... So far, its 3 hours into the works, features a scrolling map, programmer art and the workings of unit queues with a menu screen... A few rather ugly screenies to satisfy anyone wondering how bad my 'programmer art' is ;D:

798799800

As for 'will it run'... You will need:
32mb of ram, an 800x600 32 bit display, OpenGl 2.1 (although 1.x MIGHT work), 400mhz of grunt and a mouse :) As for the mac theme... Its best I leave that one alone right ;)

Oh yeah, and its written with prometheus - even more improved after god knows how many LD entries XD

Ñuño Martínez
11-04-2012, 07:24 PM
Wellcome to the contest! :)

Eric
12-04-2012, 06:49 AM
If you think your programmer art is bad, you haven't seen mine (which you you should see soon).

RTS is interesting - hopefully not too ambitious ;) -get those units rolling!

code_glitch
12-04-2012, 08:08 PM
Well, progress is being made... Code for some dialogs is under way, the launcher works and the building queue is in place... Now you can scroll around, right click any space and see available options :) Not bad... Time tog et to some content making and GUI design :D

806

Edit: Just a thought, but whats the view on recycling code from your own codebase for use in the PGD entry?

code_glitch
12-04-2012, 09:53 PM
Wow, integrating some old code for window and control management to produce an interactive, 'dynamically generated' interface went better than expected... It still has some art and text from the old program but hey, the fundamentals are there right? :D

807

for those whom are curious, that window is made from a script file (this exact one as it where :)):


#START#
NX_ComplianceFlag=NX10x,NX166-S,NX166-X,NX166-W
Visible=True
Position.X=200
Position.Y=300
Id=StarInfoWindow
Width=425
Height=150
BackgroundImage=data/NX166OUI/windowbackground.png
Controls=12
Control[1].Id=WindowName
Control[1].X=2
Control[1].Y=2
Control[1].Type=103
Control[1].Value=Star Information:
Control[1].ControlColour.R=255
Control[1].ControlColour.G=255
Control[1].ControlColour.B=0
Control[1].ControlColour.A=255
Control[2].Id=Star_Name
Control[2].X=200
Control[2].Y=20
Control[2].Type=103
Control[2].Value=XYZ
Control[2].ControlColour.R=255
Control[2].ControlColour.G=255
Control[2].ControlColour.B=0
Control[2].ControlColour.A=255
Control[3].Id=Star_Info_Name
Control[3].X=2
Control[3].Y=20
Control[3].Type=103
Control[3].Value=Star Name:
Control[3].ControlColour.R=255
Control[3].ControlColour.G=255
Control[3].ControlColour.B=0
Control[3].ControlColour.A=255
Control[4].Id=Star_Info_Resources
Control[4].X=2
Control[4].Y=34
Control[4].Type=103
Control[4].Value=Resources:
Control[4].ControlColour.R=255
Control[4].ControlColour.G=255
Control[4].ControlColour.B=0
Control[4].ControlColour.A=255
Control[5].Id=Star_Resources
Control[5].X=200
Control[5].Y=34
Control[5].Type=103
Control[5].Value=XYZ
Control[5].ControlColour.R=255
Control[5].ControlColour.G=255
Control[5].ControlColour.B=0
Control[5].ControlColour.A=255
Control[6].Id=Star_Info_Industry
Control[6].X=2
Control[6].Y=46
Control[6].Type=103
Control[6].Value=Industry :
Control[6].ControlColour.R=255
Control[6].ControlColour.G=255
Control[6].ControlColour.B=0
Control[6].ControlColour.A=255
Control[7].Id=Star_Industry
Control[7].X=200
Control[7].Y=46
Control[7].Type=103
Control[7].Value=XYZ
Control[7].ControlColour.R=255
Control[7].ControlColour.G=255
Control[7].ControlColour.B=0
Control[7].ControlColour.A=255
Control[8].Id=Star_Info_Economy
Control[8].X=2
Control[8].Y=58
Control[8].Type=103
Control[8].Value=Economy :
Control[8].ControlColour.R=255
Control[8].ControlColour.G=255
Control[8].ControlColour.B=0
Control[8].ControlColour.A=255
Control[9].Id=Star_Economy
Control[9].X=200
Control[9].Y=58
Control[9].Type=103
Control[9].Value=XYZ
Control[9].ControlColour.R=255
Control[9].ControlColour.G=255
Control[9].ControlColour.B=0
Control[9].ControlColour.A=255
Control[10].Id=Star_Info_Science
Control[10].X=2
Control[10].Y=70
Control[10].Type=103
Control[10].Value=Science :
Control[10].ControlColour.R=255
Control[10].ControlColour.G=255
Control[10].ControlColour.B=0
Control[10].ControlColour.A=255
Control[11].Id=Star_Science
Control[11].X=200
Control[11].Y=70
Control[11].Type=103
Control[11].Value=XYZ
Control[11].ControlColour.R=255
Control[11].ControlColour.G=255
Control[11].ControlColour.B=0
Control[11].ControlColour.A=255
Control[12].Id=Star_Upgrade
Control[12].X=2
Control[12].Y=100
Control[12].Width=360
Control[12].Height=18
Control[12].Type=101
Control[12].Value=Star Upgrade Options
Control[12].Action=NewWindow$data/StarUpgradeWindow.pcff1
Control[12].ControlColour.R=255
Control[12].ControlColour.G=255
Control[12].ControlColour.B=255
Control[12].ControlColour.A=255
#END#


Edit: Forgot to mention, dragging windows is ugly, and its clitchy but for such a short job, I'll call it progress :)

paul_nicholls
12-04-2012, 10:21 PM
Nice! Any chance of a larger screenshot? The attached one is rather small to see all the details...

Eric
13-04-2012, 11:50 AM
Nice! Any chance of a larger screenshot? The attached one is rather small to see all the details...
I agree, and I've had the same outcome for my attached screen-shots too (they got downsized and blurred).

@WILL: any chance of loosening up the restrictions for attached screen-shots?
Hosting the image elsewhere is possible but will have other issues (dead links, no thumbnails...)

code_glitch
13-04-2012, 01:49 PM
Well another screenshot with some fixed bugs, a more appropriate interface and the working dialog system for making stuff... In HD since I linked to my public file on dropbox :D

http://dl.dropbox.com/u/4853895/PGD Files/GMCOM_FRI13AM2.png

paul_nicholls
13-04-2012, 01:57 PM
Very nice!

code_glitch
15-04-2012, 05:41 PM
Well, after a saturday off, and taking a break from some holiday homework, I got the ball rolling for an hour and got the script execution system for the window dialogs to do stuff with the game data... Its all in the console for now, but at least its all hooked up and working from a simple right click action anywhere on the map. Enjoy ;)

http://dl.dropbox.com/u/4853895/PGD Files/GMCOM_SUN15PM1.png

Its kind of hard to believe I'm now going to spend most of my time making content and scripts for this to run... Oh how I hate the annoying 'language' i developed for this -_-

WILL
15-04-2012, 07:31 PM
Nice GUI. Don't forget to draw yourself some simple units and building art.


Edit: Just a thought, but whats the view on recycling code from your own codebase for use in the PGD entry?

Go for it. Just don't take from others without permission and you're golden. ;)

code_glitch
15-04-2012, 08:34 PM
Most of the work on the actual mechanics is done now, so its as you say, mainly art and scripting up some events etc... There are a few more choices to make, but overall I can say its progressing nicely. The UI, is... Well, its a bit of a botch job if I'm honest - I'm extremely surprised its as stable as it is and it only has one or two glitches at the moment. For instance, it sometimes hands over the wrong co-ordinates to build things, when moving a window, the map disappears etc...

Though the recycle rule is a saviour :) Most of the code is pulled from other experiments, its a case of having a ~500 line program, ~900 lines in the backend and the rest is prometheus. Around 6,500 all in if I recall...

Ñuño Martínez
16-04-2012, 11:20 AM
Me wants see units in action. ;)

code_glitch
16-04-2012, 03:02 PM
Id you mean source code, thats no problem :), sharing isn't either since my code is free for anyone else to use as long as you dont take it and call it your own ;) 'course any modifications you make to my source are yours and all... Just some common sense XD

Heres the link to the RTS so far... The UI is a quick experiment on my behalf to make a 'feel'. Any feedback would be very welcome - I would highly advise against trying this on windows of any kind so far - the windows version of PM_Window uses a botch of an SDL implementation and I don't think the mouse works (yet). X11 works well enough. The binaries are for x64 Linux Mint 11 (Katya) and should work equally well on ubuntu x64 systems also... However, I can recommend running a ./package before you start. You'll need:
The SDL dev libraries, XLIB an X11 development libraries as well as the standard opengl stuff... If there are any issues, let me know and I'll whip up an automated script. And without further ado, heres that link:

http://dl.dropbox.com/u/4853895/PGD Files/GMCOM_Complete_MON16PM1.zip

Note: the prometheus units in there are experimental, and may/may not be the latest in the SVN folder. Theya re just what seems to work best. The odd one out is XS_Font which is from another project and uses tilesets to load a 'font sheet' from Andrus excellent ZenFont utility with a custom define file to link characters to the tiles. NX166 units refers to a test project I made to try out handle based UIs which worked in a decent manner, and thus was thrown into my entry, the uPNG and uTGA units are from Bero and provide TGA and PNG support in very small size units (hence the u, for the mu letter that signifies micro :))

code_glitch
16-04-2012, 04:10 PM
Hmm... Houston, we have a problem....

Its called VSync >:( I added a bit of code to flash a white screen every time a game cycle ran over its target time to get the magic 50 frames/second... Things flashed a lot... So I set no deadline and watched. In THEORY, every cycle would render later than 0ms and it would be pure white... But no difference happened. So I looked at the FPS counter. Rock solid 60FPS, 30% core utilization -_-. in other words, VSYNC is holding everything up. This is problematic indeed.

Jimmy Valavanis
16-04-2012, 04:37 PM
You can change VSYNC with wglSwapIntervalEXT() {Windows/using dglOpengl.pas}, I don't know if this help :


At first call Read_WGL_EXT_swap_control();

Then you can adjust VSYNC with





type
TVSyncMode = (vsmSync, vsmNoSync);

procedure Sync(vsync: TVSyncMode);
var
i : Integer;
begin
if WGL_EXT_swap_control then
begin
i := wglGetSwapIntervalEXT;
case VSync of
vsmSync : if i<>1 then wglSwapIntervalEXT(1);
vsmNoSync : if i<>0 then wglSwapIntervalEXT(0);
else
Assert(False);
end;
end;

end;

code_glitch
16-04-2012, 05:11 PM
Hmm, thanks for that, I'll make sure to put a note in my code once I get my windows virtual machine booted and ready to compile :) Of course, the focus before that is getting the mouse support thrown into the SDL event code for windows and (maybe) mac OS X!

Thanks for the find though :)

Edit:

Thanks to some free time, the scroll speed now varies based on how close to the edge of the screen the cursor is, woo :)
Also, by not running upx on the binary increased performance in terms of 'feel' on a grand scale. The downside to that? Its no 896K for the exe rather than 280... Its a bit bulky, bu I'll see if I can't cut some bulk out of my units once i'm finished with the entry, although I reckon its more due to the fact I'm using OpenGl and XLib directly (from a prometheus point of view) ^^

code_glitch
16-04-2012, 09:08 PM
Well, after a good day of development, things are turning out to be much easier than I'd originally anticipated :)

Now on what is virtually 600 lines of main program, a few glitches are still present, but the construction system is working (albeit immediate) and its doing everything correctly in terms of executing the 'scripts' and making stuff happen in the game... I think this next screenshot sums it up rather well :D

http://dl.dropbox.com/u/4853895/PGD Files/GMCOM_MON16PM2.png

paul_nicholls
16-04-2012, 10:13 PM
Must...build...factory....and....rule...the...worl d... :D
Looks very good...much more than what i have done :)

code_glitch
28-04-2012, 06:54 PM
Well, it would look I have to say two things -
1. This wont be entered into PGD challenge number 2.
2. This will continue to be developed as an open source project... Things are working nicely and its giving some interesting results on how different approaches to code are working together...

The simple fact is that I'm now around 2 weeks and a little bit of my final exams, and that consequently my time for code has decreased exponentially :/

WILL
28-04-2012, 10:14 PM
That's unfortunate Ben. Does the existing game meet the requirements for the challenge though? Even incomplete it does give one more game to the challenge showcase. You know how important that is for the PGD community, right?

WILL
30-04-2012, 03:52 AM
Hey Ben. 2 day extension, does that put you back in? That's lots of time for most developers. :)

code_glitch
30-04-2012, 03:04 PM
Sorry WILL - I'm still going to have to pass... Its now a dabble under 2 weeks to the first chain of exams and as a result everyone is in one of those 'don't you owe me some work class?' moods... Can't say I have lots of time with reports to write and books to learn you know. I'll see if I can get the first mission scripted up and all the content made in that extension but theres going to have to be one long readme :)

A lot of bits were what I would call 'cobbled together' and as such I can't give any stability, performance of playability promises. Of course, 90% of everything is saved in config files - so if something doesnt run well on your machine, its only an edit away. The plan was to have a specific UI for that BUT given the fact I have a lecture tomorrow evening I doubt I will have much time to polish it up you know?

WILL
01-05-2012, 10:00 PM
Well you gave it a shot. At least you have something to finish later down the road for game projects. ;)