Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / - DBPro Coding Challenges -

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Aug 2005 03:06 Edited at: 18th Aug 2005 02:34
RPG Toot Part VI: Combat!
Added monster stats (str, dex, con, and int).
Also added Print_Stats() function to display our character info.
Combat is pretty simple (not much to it). No "death" added as of yet, so the fight just goes on and on. There's no control over the fight except to engage or run (simply move into the same square as the spider and you are fighting).

New Functions
Print_Stats()
Monster_Fight()
Player_Fight()

and a few changes to
Global declarations
Main Loop
Start_Monster()

Oh, and the monster taunts the player from time to time.



Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Aug 2005 11:51
Looks like I'm going to have a free day today - along with some other projects I'm working on, I'll have a stab at this challenge. I'll post a wip later today.

Quote: "are we allowed to do this in 3D (but obviously not First Person)"


Isn't first person view acceptable then for an rpg? That's kind of what I had in mind.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Aug 2005 16:28
A few hours later ...... !

Okay, I figured that the first thing I would start with for my rpg would be my world. Fancied doing something 'outdoors' rather than in a dungeon as seems to be popular - so I've created a random world generator. No data statements, so you really never know what you're going to get. Now, I know this isn't about graphics, but hopefully some of the code (remarked AND indented ) will be instructive for those who read it.

For example, the terraforming function is quite interesting. Rather than just randomizing a matrix (which never looks anything like natural terrain), I've created a set of random peaks, and used spring physics (remember that challenge?!) to enable the peaks to 'stretch' set the other parts of the matrix to suitable heights.

Also, some people may find the check_for_free_object-number function handy - it puts an end to the need for remembering object numbers and enables the use of words instead.

Notice, also, that if you wander down to the water line, you'll see that the water comes in and out over the terrain.

Now I've created a basic world, the next step is to create some characters. Might stick a few buildings around too.



Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 17th Aug 2005 17:25
Wow Ric, I really like that landscape you've created - quite stylistic and very different from most others I've seen. Though, I think if you're going to be adding plain old boxy buildings, then you might have trouble finding flat space without modification Towers in the shape of cylinders, however....
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Aug 2005 18:11 Edited at: 18th Aug 2005 02:35
Wow Ric! Very nicely done. I like the spikey landscape and the bill-board scenery . It's a great start. Of course it only runs at 13 fps on my work pc (and I'm probably not getting the full effects). I had to speed up the camera movement just to get anywhere.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 17th Aug 2005 19:22 Edited at: 17th Aug 2005 21:35
13fps - I thought I was playing it safe setting the sync rate to 30!

update:

just graphical, but made the water look more sparkly, and the distant mountains look more, err...... distant.

<edit>

just added in some houses too.



RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 17th Aug 2005 22:21 Edited at: 18th Aug 2005 02:33
Very cool Ric. I'm sure I don't need to tell you that the placement of the houses needs a bit of work . But I will



Attachments

Login to view attachments
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 17th Aug 2005 23:07 Edited at: 17th Aug 2005 23:13
RiiDii could you save your sig as a JPEG/PNG please, I'm silently watching the mmorpg thread and I read this thread (obviously) and it reloads it each time, taking quite a while to load. It's a nice sig though thanks.

EDIT: I agree with RiiDii there


Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Aug 2005 02:34 Edited at: 18th Aug 2005 02:35
Sorry about that Neofish. I've changed sigs again, so hopefully that's better. If not, I'll see about a jpeg.

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 18th Aug 2005 21:15
riddi it's a jpeg! right click it

Love games go to http://www.freewebs.com/halorc
or
http://www.freewebs.com/gamersmad
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Aug 2005 01:55 Edited at: 19th Aug 2005 01:58
ok, here is mine so far.. not much in the way of comments, however the highlights are:
Random 3D smooth terrain generation by use of memblocks and mesh's
terrain is textured like "grass" or other speckly green substance, by use of memblocks and images
Play control is by point-and-click mouse. This is done by picking the object you clicked on then combining the pick vectors with the camera coords.
Where you click a little blob fades out using some simple but nify BIT operators (I'm strangely pleased with that feature )

anywho, here is the code...


I'll work on it more soon, I hope...

Nick

EDIT:
Screeny:


My Website:

Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Aug 2005 04:11
Lush! Nice lighting and fadey stuff. Only problem for me is that everything jitters when the ball isn't moving.

Haven't had time to work on mine today - probably do some more tomorrow, eg. collision, entering buildings through doors etc.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Aug 2005 06:41
I was hoping to do multiplayer with mine, but I currently only have one DX compatible computer.

PETA - People for the Eating of Tasty Animals
FDC
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 19th Aug 2005 07:29
i give up, to many things to do but impatient to see your whole program, they looks very interesting!

+
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Aug 2005 07:43
Nicholas: Very very nice! And I agree with FDC, it'll be great to see more from this one.

So far, though, as RPG's go, I'd say Tinkergirl is in the lead.

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 19th Aug 2005 08:44
Woo! Though, I seriously doubt I'll hold this lead - you lot have a lot more experience in this than I do (and it's getting harder to do things ) For examples of cool competitors...

Ric: Still very cool landscape, the modification to the water was particularly nice and added movement. Very pretty. Well done houses for their simplicity. (I'd still prefer towers though, but your houses are cool )

Nicholas: Wow, some very clever stuff there. It did make me feel like I was playing a possessed golfball, but I suppose that's a whole game idea in its self
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Aug 2005 09:51
Quote: "i give up, to many things to do "


FDC, I hope you will be able to join us then when you have some more free time. But don't give up. If you keep an eye on this thread, take a look at the codes posted. Tear them apart and learn something from them. That's the whole point of this thread. Maybe someday we will see an RPG or FPS game from you.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Aug 2005 12:33
Quote: "you lot have a lot more experience in this than I do "


Not sure about that! I didn't know what an rpg was until the beginning of this challenge .... and I just added sliding collision by studying your code! Will post update later.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Aug 2005 15:22 Edited at: 19th Aug 2005 15:53
I'm actually really pleased with the lighting effect in this. I thought it would look crappy and it did before I put the texture on the terrain. For some reason, textures objects light up MUCH better than non-texture objects!

I'd REALLY like to do more on this - i'm into it now I have a few idea's brewing..

EDIT:
Could someone do me a favour? Could someone compile my program, zip it and chuck it on as an attachment here please? I'm at work and I'm curious what my crappy work PC will do with it (when I say crappy I mean the onboard (shudders) "graphics card", apart from that its pretty nice: P4 2.8Ghz, 1Gb DDR333, DVD/CDRW, WinXP Pro, Office 2003 Pro).

Thanks

My Website:
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Aug 2005 17:39
Here you go Nicholas. I've included two. The first one is unchanged. The first one wouldn't run on my pc at work. So I remmed out the Set Display Mode, which works for me, and that's the second one.

Attachments

Login to view attachments
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Aug 2005 18:03 Edited at: 19th Aug 2005 18:05
FANK U

Ok, firstly.. You're using the version of 5.8 which requires d3dx9_24.dll.. This is easily sorted - just use the attached DLL in with the EXE and it works (must be in the same folder)...
The first and normal exe (1280x1024x32) runs at 14-19FPS on my work PC.. Not TOOOOOOO bad, but it'll be very poor when AI gets put in.
The second EXE (looks like 800x600?) Runs at a very acceptable 40fps

This is good news for me I might have a play about with it to try to make the landscape more efficient, maybe add it in chunks as limbs?!

Cheers Riidii - Its much appreciated.. I must bring DBPro into work one day

My Website:

Attachments

Login to view attachments
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Aug 2005 18:40
Quote: "requires d3dx9_24.dll"

Already have it. Won't help with a "Not enough video memory" error .

Thanks anyway - and I mean it. Would rather you post something I may not need than not try to help. I'd rather someone call for emergency services if they thought I needed help, than not call them if I did.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 19th Aug 2005 19:53
Made a few updates - still no game yet, but I think the ideas for the game will come to me soon!

Added:

-sliding collision
-fixed the waves, which seemed not to work properly in the last version
-you can now go into (and out of!) the houses - woohoo! Fully furnished, too!
-the boxes on the tables may be significant for the game!



Got people coming round for dinner in a few mins - suppose I better go and help out in the kitchen!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 19th Aug 2005 21:26 Edited at: 19th Aug 2005 21:26
Quote: "dinner"

Now there's an odd word. What does it mean?

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Aug 2005 21:54
Quote: "Quote: "dinner"
Now there's an odd word. What does it mean? "


I believe that's a fancy word for pizza and tv trays

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 01:28
Ok - update 2:


This now has enemies in it. Up to 5 (or 6 - think I did the logic wrong)... no.. no.. there is MEANT to be 6 enemies

They appear from the ground as yellow clones!! MWUHAHAHA...

You must defeat/delete them by hitting them with your bar-o-spacekey which is activated by the.. err.. space key

I have also modifed the terrain generation to use a function and tweaked it a little.

Slight issue for me is the frickin bar collision wont work! :-( You can be hitting them with the bar-o-spacekey and nothing happens until you run into them!!!

Also - I made nice little semi-transparent health bars I like my transparencies.. if only it didn't kill the FPS quite so much :-(

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Aug 2005 02:32
Nice visuals - love those health bars. Slight touch of the 'AI' challenge about it!

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 02:37
hehe - its a favoured technique now any idea why my bar-o-spacekey's wont collide correctly? Do objects lose their collision data when you glue them to another objects limb?

My Website:
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Aug 2005 04:09
Pretty much, they do. Check this out. I print Object Position X, Y, Z out for object 4. You should see that these all remain at 0,0,0. I suspect the collision box is there as well. You could easily create a test code that would show that. I also inadvertently did a cool scrolling effect. Should play with it. hmmm.



Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Aug 2005 07:00
That is a downright odd scrolling thingie! I was seriously weirded out when I first saw that, until i thought - oh yeah, that'll be the scrolling

Oh, and those yellow 'clones' are strangly creepy. Amazing what you can do with a few primatives.
FDC
19
Years of Service
User Offline
Joined: 6th Aug 2005
Location:
Posted: 20th Aug 2005 07:02
i am working on my level editor...and trying to learn phpmysql...and also working on a 2d "star"shooter. I will show screen as soon as possible
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Aug 2005 09:15
Ok, not changed much but it's remarkably encouraging to put WIPs up here.

I've added levelling when you get enough XP (and appropriate size difference, think Katamari Damaci), a combat timer bar (now turn based combat) and 3 types of attacks.

Press 1 to do a rage based attack.
Press 2 to do a grace based attack.
Press 3 to do a brains based attack.

Currently, you're best off choosing a character with one huge bar and spamming that attack, but I'd like to get a selection of attacks implemented - including healing for Brains and defensive capabilities for Grace. Also, I desperately need to start adding some plains that float away with damage done and XP and cash gained. Oh well. Maybe I won't have time.



Oh, and I need the combat spam kept up for longer. 1 frame of text is too fast even for my eyes
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 13:19
OOooo thats really nice!

I'm not sure how you do the enemy damage.. I just wander round, walk into something, press 1, 2 or 3, it says something then sometimes they dissapear!

My Website:
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 15:53 Edited at: 20th Aug 2005 16:02
Update 3:


Its got a smidge longer now (536 lines )

Whats new.. well.. I solved the collision problem. Its now more of a cone-o-spacekey too. Basically, Instead of glueing I added it as a limb and then set the collision to polygons. Works well Its a shame that cones done have an end though :-(

Space still fires - but now the enemies dont get deleted, just hidden. This means there is no "jolt" while DBP deletes an object.

Oh yeah - they fight back too! Nothing happens when you run out of health yet though.

For every enemy you kill, you get about 50% health back. You also kill enemies twice as fast as they kill you.

Some code neatening and remarking has gone on too.

I'll attach a screeny in a minute...


My Website:

Attachments

Login to view attachments
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 20th Aug 2005 15:54
Looking good TG. How, though, are 'hard maths problems' involved in a fight sequence?! Is it something like "If you don't surrender, I will shout equations at you until you die of boredom!" ?

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Aug 2005 16:45
I like both wips:

TG: I like the naming of the characters and the descriptive fighting (very creative despite Ric's taunts in your general direction )

Nicholas: Why a cone? I liked my lance that I got to impale enemies on. When there's a group of them, it's like the battle scene in The Return of the King when the calvery charge the orcs (okay, much the same way that http://www.asciimation.co.nz/ is like Star Wars. Well, actually, that IS more like Star Wars than yours is like the battle scene... well, you get the idea ).

Ric: Careful, or I'll yell some vector math at you.

Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Aug 2005 18:09 Edited at: 20th Aug 2005 18:15
Ric: I was... It was late, I was tired, and I thought "Well, what would scare me most, right now..."

It's a placeholder

EDIT: Um, I can't run yours, Nicholas - I think I must be missing an upgrade or something that the trial doesn't have. Falls over at...

As it doesn't know what image width(10) is. Shame, the screeny and description sounded quite cool
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 18:28 Edited at: 20th Aug 2005 18:30
ahh yeah. image width is something that was added in 5.8.. hold on a sec, I'll modify it

EDIT:
Modification complete...


I made it a cone because I found it really hard to hit the enemy with a lance

My Website:
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Aug 2005 19:52
Am I the only one doing 2D here?

PETA - People for the Eating of Tasty Animals
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 19:53
I personally fine 2D harder than 3D.. Not sure why

My Website:
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Aug 2005 21:00
Can I ask, what time (and timezone) is our deadline? I've recently been shipped off to the US, so time's a bit weird for me right now.

And its very much easier for me to do 3d than 2d - DB makes it simpler to put a cube on the screen and move it around with a camera following it, than draw a sprite on the screen and move it similarly. Imo
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Aug 2005 21:21
I did 2D.

Deadline is Sunday evening. I usually get in late Sunday, and do the judging then. I'm in California, so Pacific time is the one to go by for this compo. I think we are -9 GMT.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 20th Aug 2005 21:23
so sunday evening + 9hrs = EARLY monday morning in GB?

My Website:
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 20th Aug 2005 21:47
Amusingly, it's California I've been moved to, so I'm well aware of the time difference. Small world. It's 8 hrs difference in LA.

For example, 9pm Sunday California time, is 5am Monday UK time.

Which is a pain in the backside for keeping in contact with family. *sighs* But ok - that's a good time area for me. Just worried that it would be about 7pm UK = 11am CA.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Aug 2005 22:44 Edited at: 20th Aug 2005 22:45
Welcome to LA TG! Hope you enjoy your stay. Could be as late as 9am UK, or about midnight here. Just don't expect me to be too coherent looking through code at that time. I usually have looked and pretty much decided before then (only have to handle last minute entries).

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Aug 2005 07:55
<Update>

Done: loads

To do still: even more!

Not sure if I'll get any further - my gf is already annoyed at me for not going to bed last night. Besides, once you're over the 1000 line stage, it gets really buggy!



Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 21st Aug 2005 08:16
Well, I was about to say "Oh no - you have a secret weapon - plot!!", but then it went and crashed on me, just after the Blue Island background screen. *sighs* I'd never seen it crash like that before: Visual Studio said it crashes in the compiler, something to do with dbprosounddebug.dll. Chances are it's because I don't have something in my version, I suppose.

Still - plot! How can I compete with plot, eh?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 21st Aug 2005 09:05
Ummm... <something drops to the floor> wow! Ric. I am honestly sitting here trying to think about what to say. I can only think of one word each time: "Wow!"

Needless to say, it worked (enough) on my pc. It didn't work so well once my navigation device kicked in. The map worked, but I couldn't see anything 3D except a white box. Otherwise it was pitch black - it was suddenly night time? And movement was ssslllooowww.

Still... Wow!

Quote: "How can I compete with plot, eh?"

Fight fire with fire?

Quote: "something to do with dbprosounddebug.dll"

Wait... no way!
<Turns on volume>
<Runs Ric's code again>
Ummm... wow!
<thinks and thinks, but only one word comes to mind>
Wow!
<bows in Ric's general direction>
<presses the [Post Message] button>

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 21st Aug 2005 13:47
I'm intruiged! I'll try this later... Going out for a meal now to celebrate my sisters stunning AS Level results

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 21st Aug 2005 16:37 Edited at: 21st Aug 2005 16:39
Ah yes - forgot to say, uses the createsound() function which needs version 5.8. You could delete the createsound() function, and then use the error message reports to weed out the few sound commands that won't then work.

Thanks for the comments Rii - I was working on the nav-system when I ran out of steam, hence the reason it didn't work properly.

<Update>



The nav system now works (not extremely accurate, but useable I think). Also it uses a static image now rather than a live camera, so game speed should be increased.

Other features I didn't already mention:

- footstep sounds ... press <shift> to run, and the sounds speed up to.
- Bobbing up and down effect when in water!
- Wave noise gets louder when you get closer to the water
- You can enter all houses (if you get the key), but there is only actually one room for all the houses, to save on polygons - later I might do some randomizing of the furnature so it always looks different.
- Intro scene and story line!
- Message alerts at various stages with cool 'ding' noise!

Might have one last stab at it later.

Login to post a reply

Server time is: 2024-11-23 12:00:55
Your offset time is: 2024-11-23 12:00:55