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
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Apr 2005 00:47 Edited at: 3rd Apr 2005 00:54
If you wanted to code a virtual aquarium then it's going to be big ..... but I don't think it has to be ..... I'm sure a really simple attempt could be done in a twenty liner. ie. no graphics, just a few messages that say you killed your pet if you fed it too much or too little. But I'll make it seven days just to try and entice you into entering! Surely in that amount of time some people will be able to code an entire virtual zoo Hmmm ..... virtual aquarium ..... got myself thinking .......

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2005 01:00
Lol - oh go on then - i'll try to squeeze some time in for it..

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 3rd Apr 2005 01:21
kewl challenge and i've got my eyes on virtual aquarium to lol

My Website:

robo cat
20
Years of Service
User Offline
Joined: 23rd Feb 2004
Location: In a cat litter tray, near you...
Posted: 3rd Apr 2005 02:08 Edited at: 3rd Apr 2005 02:10
I've got a great idea for a virtual pet game. One question though, does the pet have to be owned by the player or can the player be a pet alongside other pets (such as cats and dogs) competiting for an NPCs affection? Thats kinda what mine will be like.

Of course the other pets would have the same sort of pet AI, they will fetch a ball etc but the fun would come when the NPC throws a ball and you and other pets race for it - if you want to that is.

Simple... yet fun!
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 3rd Apr 2005 02:18 Edited at: 5th Apr 2005 03:03
555th post

I don't think I'll enter due to hating AI An idea for a later challenge: make gui with no media

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Apr 2005 03:08 Edited at: 3rd Apr 2005 03:09
Quote: " ... does the pet have to be owned by the player or can the player be a pet alongside other pets ... "


However you like! With a tag like Robocat, we're all expecting great thing from you! Your idea sound like an animal version of the Sims!

@Neofish - hey another animal tag - you really should enter some fishy kind of entry.

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 3rd Apr 2005 03:24
I would do, but won't

I don't see why people think that 133b is spelt 1337?!
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2005 03:33
I keep hearing this - what is an NPC?

I'm gonna work on this tonight, I have no idea what I'm gonna do though.. I quite litterally have no idea!! Lol..

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 3rd Apr 2005 04:03 Edited at: 3rd Apr 2005 04:04
NPC=Non Player Characters

just so ppl get some ideas (and no1 plz steal this one)
i am working on one that will be realtime (hours go by like every 5 sec. or something) and you can start out by buying 2 fish of your choice. each fish has a description and different +/-. than you take care of ur fish but upgraded tank sizes and new filters,lights, etc.

My Website:

robo cat
20
Years of Service
User Offline
Joined: 23rd Feb 2004
Location: In a cat litter tray, near you...
Posted: 3rd Apr 2005 04:11
Unfortunately I've remembered I won't be able to take part in this challenge, though I was hoping to. I'd completely forgotten that I'm away on holiday all next week.

Good luck to all who take part.

Simple... yet fun!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Apr 2005 06:32
Quote: "Time limit - <edit> 7 days (until Saturday night, 9/1/05)"


No matter how I look at it, I can't get the date for next saturday out of that.

Sept. 1 or Jan. 9 ???

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: 3rd Apr 2005 06:47
9th April, He hit 1 instead of 4.. Easily done on the Num pad.

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Apr 2005 07:03 Edited at: 3rd Apr 2005 07:04
Ooops. Yeah, what Nick said.

Hey Phaelax, what's with the avatar - you mod-baiting?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2005 09:17
I honest to god cant think of anything that'd be worth entering into this competition that i'd have time to do!

I was thinking of some kind of ant colony idea.. But its not really a virtual pet as its fairly un-interactive.

I also thought about an aquarium, but again, all you can really do is being done by someone else.

Maybe sleep will help.. And Counterstrike.. And maybe some Richard Burns Rally...

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 3rd Apr 2005 10:10
Ya im coming well on my fish game here is how i am going so far:

plz comment
it is just the bones of the code for now but not bad for a quick job

My Website:

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 3rd Apr 2005 11:29 Edited at: 3rd Apr 2005 11:37
Wow - that's a really great start Kimo, I'm impressed!

@Nick - funny that ..... once Kimo bagged the aquarium idea, I was thinking of ants for some reason too. Then I thought of Giant Pandas (Save them from extinction type thing). Now I'm thinking of Bunny Rabbits - easier to get them breeding. Hmm... think I need to sleep on it, too .......

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 3rd Apr 2005 12:25 Edited at: 3rd Apr 2005 12:28
Ok, sleep time..

I am making a "feed the ant" simulator. Basically, your ants get hungry and gradually shrink. Currently, none die (yet).

You feed them by positioning the pointer and clicking. The longer you hold, the more feed gets put down.

Currently when an ant gets to the feed, it eats it all and grows.

If there is no feed within range of an ant, it returns to its patrol point and starts circling it. Once at the patrol point, its meant to randomly move.. But I need to work on that a bit more.

I also want to make it do when the ant gets too hungry, it dies and maybe turns into a small pile of feed. When an ant is above a certain size, it starts having baby ants. Each birth of a new ant will take off say 25% of its hunger, thus it hopefully wont start spurting babies

I think the aim will be to see how long you can last without killing all your ants, or maybe just keeping more than 2 alive?

Anywho - here is the code and, as usual, thoughts are very appreciated.



edit: Ah go on, a screeny too



My Website:

Attachments

Login to view attachments
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Apr 2005 00:28
Can we use existing code of our own to make the interface/GUI, so applying the AI is easier?

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2005 01:17
Cant see why not - you wrote the code!

And if reuseable code is bad, then Java would be much less popular Hehe.

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Apr 2005 01:28
@ Neofish - aha, you're entering after all? Excellent! Yes, you can use existing code.

@Nick - looks interesting, but the ants just seem to run off my screen and never come back .....

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2005 01:38
LMAO - interesting.. they dont on mine. BAD ANTS

working on it right now... Thought its so sunny for the UK I might go out kiting...

My Website:
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Apr 2005 01:48 Edited at: 4th Apr 2005 01:48
Hmmm.... physics challenge for the future - kite simulator .... for those non-windy days ......

KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 4th Apr 2005 01:58
@Ric
lol ya good idea ric

@Nicholas
well just thought id say my real name is Nicholas to lol and the ants run off the screen for me to

@SOMEONE WHO CAN HELP
could some1 plz look at my aquarium code i entered earlier and help me out so that only the fish on Aquarium Camera will go behind "menu" but so i can make it some certain 3D objects can go in front of that. i tried draw to front and draw sprites first but i dont know(probably cause i used Ric's "Fish" code and i didn't get that to well

My Website:

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 4th Apr 2005 02:19 Edited at: 4th Apr 2005 02:21
Quote: "Ric's "Fish" code "


?? Don't think it's mine - but make sure you do give credit to any authors whose code you've used.

I never use sprites - always 3d planes. That way you can position them infront or behind other 3d objects as you like.

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2005 02:20
Huh? You mean you want some 3D objects behind the menu and some in front? You using sprites? Not sure if you can do that with sprites.

I'll look into the running off the screen thing - I dont know why they're doing that. They might SOMETIMES do it, but they should stay on..

A Kite simualtor would be cool! Would be really nice to be able to simulate them accurately, not just a plane that goes up and down

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 4th Apr 2005 04:15 Edited at: 4th Apr 2005 04:27
dont worry guys i got the menu thing figured out but i need help on how to like make a pause (without sleeping and holding up everything) after you click a button otherwise it clicks to fast and you skip like 5 things ( i have tried for it to do like:

repeat
all of my crap
until mouseclick()=0

but that doesn't work it still skips. the only way is if you click SUPER fast so it doesn't plz help on this.


<EDIT>
NVM I GOT IT LOL THX ANYWAYS
i figured it out while i was typing the message just wasn't sure it would work but it did

My Website:

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Apr 2005 05:35 Edited at: 4th Apr 2005 10:37
Yes I decided I would take part, my idea isn't very good but I had an idea for the way you train up the pet Atm all the code is gui (ported) and landscape setting up, which is 237 lines

I'm glad I can use my GUI code as it will allow me to focus on the pet thing and have a nice way of applying actions (also it wont be overly complex code, as I can hardcode the menus in, while the original project was aimed at letting the user do it).


EDIT: I've done 472 commented lines and I still haven't got round to the AI

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Apr 2005 12:40
Kimo, half your code isn't indented, bad programmer! *slaps kimo with a large trout*

Well I've started a virtual pet, following more along the design of the tomagouchi or whatever the heck those key chain things were called.

PETA - People for the Eating of Tasty Animals
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Apr 2005 12:48
They were annoying but addictive

I'm not exactly sure what I'm doing, but the pet thing will try to keep itself alive, but you supply/dont supply food...yes the AI sucks, but I need to learn

(520+ lines)

KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 4th Apr 2005 13:34
ok im updating my game. 1001 lines *sigh* im soooo tired alot to type over weekend starting from scratch
@Everyone who as knowin me for a while
Please say if you have knowin me for a while if you think i have improved as a coder?
@Phaelax
All right i went through all 1001 lines of code and indented just for you lol

well here it is:

plz plz plz comment with ideas or comments

My Website:

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Apr 2005 14:04 Edited at: 4th Apr 2005 14:06
I need to have a closer look, but I couldn't seem to buy a fish or anything maybe I'm doing it wrong EDIT Maybe I should have read the CANT BUY ANYTHING notice

Anyway, progress report at 560 lines: No AI just yet, but the sub systems are there, such as health, which it will run on. For example your pet gains in levels (Also he's a rather fetching shade of black ).

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Apr 2005 16:29
Lookin good Kimo. Can't buy anything yet? Oh, and you should add the GloFish, those are sweet!

PETA - People for the Eating of Tasty Animals
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 4th Apr 2005 21:45 Edited at: 4th Apr 2005 21:47
yea i'll be putting AI in tonight or rather starting it there is so many factors in everything ex.:
To determine the cleanness of water you need to include:
-Tank Size
-Filter
-Amount of Fish
-Size if Fish
-PH and DH tablets
-Medicine put in water
-Plants and there "health"
-And mostly TIME

well plz commenting and gl on your pet NeoFish sounds fun also are you entering Phaelax.

My Website:

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th Apr 2005 21:49
whats DH?

My Website:
KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 4th Apr 2005 21:52
or "dh"
dh=hardness of water i added in my newest code not old one

My Website:

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Apr 2005 00:58
Good stuff Kimo - you certainly know your stuff when it comes to aquariums! Looks good so far.

KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 5th Apr 2005 03:07
lol thx although i have had quite a few aquariums i looked alot of it up just looked up the fish first than looked at all the different data needed

My Website:

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Apr 2005 04:58 Edited at: 5th Apr 2005 04:59
Improvement to the ants game



Some points:
1) Make sure the display res is ok for your setup
2) I have fixed the problem with the ants just running away. It was caused by a combination of a lower framerate than me and my bad coding using the curve angle and curvevalue commands.
3) Ants now die. When they die - they turn into a small pile of food
4) Ants now give birth. When the ants hunger is above 50%, the reproduction progress bar goes up. After 6 second, a new mini ant is born.
5) Ants speed is based on their hunger. The fatter they are - the slower they are.
6) Display bars. You no longer have to judge how hungry your ants are by their size - you have a pretty display bar.

Its all round improved right now. Let me know what you think.

EDIT:
I'd like to draw your attention to this thread:
http://forum.thegamecreators.com/?m=forum_view&t=51760&b=1
If you've played the game for 1 minute - I think you'll know why I want to do this Hehe..

My Website:
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 5th Apr 2005 05:19
hehe i got them all off the screen

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Apr 2005 05:45
Good improvements - love the display bars. Bit confusing figuring out what the different colours are, though. At the moment, there is a natural balance between who gets the food - the smaller ones go faster, so they are less likely to starve. It may add a bit more of a challenge for the user, though, if you made the big ones faster - that way you would have to be more clever with where you place the food. I do like the way they compete for food - I guess you gravity balls code must have helped.

Idea .... (if you feel inclined!) You could divide the ants into 2 species - eg. red ants and blue ants.

You could make one species slightly faster than the other, and then the challenge for the user would be to place the food in the right places so that the weaker species survives and the stronger species dies out. You could even allow the user to put down poison with a right click of the mouse, which does exactly the opposite of the food - then you'd have to be careful about putting it down in the right places so as not to kill your own species .......

..... yes, I guess you were right - this could be a BIG project!

KimoSabi
19
Years of Service
User Offline
Joined: 18th Jan 2005
Location:
Posted: 5th Apr 2005 05:47
lol i changed the max ants to 99 that was chaotic but a question are you going to add a point to the game?

My Website:

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Apr 2005 07:44
I'm trying to think of a point..

Initially, I was thinking of making it 1 minute long and the target would be to get as many ants as possible born and as few die as possible, and the longer the game goes on the slower your food piles are made and therefore it gets harder to feed all the ants. Something like 5 points per ant left alive, 10 points for each that die?

I'm in two minds about the speed of the ants. In 1 way, its good that the smaller ants go faster for the food (and realistic in that fatter ants move slower), however it would be more challenging if the ants nearer death move slower. Ideally, there would be a target "weight" for the ant then you reduce the speed by the absolute difference between its current weight and the target weight. The ants are born at 100%. At 75% they die. At 150% they become "fertile" they max-out at 300%.

I do like the idea of the red vs blue ants.. That has some potential. I'll have a think about that.. Sounds priomising.

What I like right now is the project has a number of options open to it and could evolve into nearly anything

Btw: There is no gravity maths used in this at all The ants have a heading and they're always trying to aim at either the closest piece of food or a patrol point. The curvature is simply done by smoothing out the difference between the angle they're facing and the angle between them and the target

Cheers for the positive feedback

My Website:
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Apr 2005 07:53
Nice ant game. Gets a bit hectic if you change it to make 100 ants and -..what? no, nothing.


"Lets migrate like bricks" - Me
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Apr 2005 07:57
huh?

My Website:
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Apr 2005 07:59
Just a poor attempt at humour. I'm tired... maybe a bit of food will wake me up.

Kimo, perhaps for your game you could use Ric's code that made that bubble sound, that might work well.


"Lets migrate like bricks" - Me
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Apr 2005 08:08
Anyone with an animal in their Avatar has to enter.

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 5th Apr 2005 08:14
Damn....btw do I get extra points if my pet is cute?

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 5th Apr 2005 08:51
Cuteness factor may play a small part in the judging - although AI is the main critereon!

Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 5th Apr 2005 09:00
I doubt you will class a small black square as cute

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Apr 2005 09:05
Quote: " Anyone with an animal in their Avatar has to enter."

I would love to, but I'm rather busy with projects at the moment.


"Lets migrate like bricks" - Me

Login to post a reply

Server time is: 2024-11-22 04:14:47
Your offset time is: 2024-11-22 04:14:47