Coding Competition- 27/11 to 11/12

Started by Babar, Sun 27/11/2005 11:24:49

Previous topic - Next topic

Babar

This time round, the competition is a little more peaceful. You must create a trading system. Like the shopkeeper guy in RPGs, or the lonely space station in in trading sims. You know the stuff- buying, selling, profitting, etc.

Here are the rules:
1. Must be open-source. We can hardly inspect your coding if we cant see it.
2. Must contain instructions for how to add to an existing game, this will obviously be easier if the scripting is done as a module
3. Only use of the 3D, TCP/IP and maths plugins are allowed
4. Must provide sample game using the trade engine (obviously!)
5. Team efforts are allowed, and you're probably expected to get help for sprites, etc from elsewhere.
6. As far as possible, entries will be judged on their scripting and gameplay rather than GFX, SFX, music, etc.
7. Winner will be decided by 1 week of voting at the end.

And please, like MAGS, post here if you're thinking of entering. And please post if you're a spriter, etc. who can offer their services to scripters who need a few images of a shopkeeper or space station or whatever.

Let the peaceful trade commence!

EDIT: Bzzzp! Fwap! What?
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Phemar

Hmmmm ... I don't understand what you mean by 'providing a sample game using the fight engine'?

Do you mean any fight engine, or THE fight engine?

EDIT: Oh, I see ... did you ctrl c that from the other thread and forget to change it?

DoorKnobHandle

I probably won't find the time to enter ( because of ...other... projects 8) ) but I was just going to say, that I love how you guys keep coming up with good coding ideas. Keep it up.

Akumayo

I am soo entering this one!  I have already begun development, inside I hope no one else enters... then I would win, MUHAHAHAHA.... anyway, good luck to everyone else!  I hope this comp continues to live!
"Power is not a means - it is an end."

Akumayo

#4
Here, it is finished.Ã,  I scrapped it together rather quickly.Ã,  It is very basic, and very adaptable, if, of course, you take the time to understand it.Ã,  The file itself is a test "game".Ã,  It is one room, two roger's standing in it.Ã,  (Your the roger that's off the walkable area).Ã,  You can sell items to the shopkeeper by clicking on him with them (a "do you really want to sell" gui or keypress can be added easily) and you can talk to the shopkeeper to access his shop, where three items are available.Ã,  You understand, of course, that this "game" is far from glamorous, has horribly drawn everthing, but beautiful coding within.Ã, 
Ã,  Ã,  Ã, The system itself is ListBox based, and you could probably change it up rather easily.  As far as adding it to an existing game, you'd have to export the ListBox that controls the shop, and copy the code out, maybe even export the shopkeeper character.  This won't take too long.Ã,  Anyway, without further staling, here's my entry:
Akumayo's Shop!
http://www.2dadventure.com/ags/akumayosshop.zip

-Regards and happy coding, Akumayo
"Power is not a means - it is an end."

Ashen

Presenting my demo game:
Quest for Blue Cup!
In which you play a lovable greenhaired scamp, who wants to buy a Blue Cup for someone for Christmas. Or something. The graphics are either from Instagame, RPGM2K, or non-existant. (Well,   prettiness of the demo wasn't one of the critera ...)

And here's the source code:
Ashens Trade Engine Thing

Let's see ... It's Inventory based, and centered around a module & 3 GUIs. Instructions for using it in another game are included in the module, as are descriptions of the functions used - hopefully they shoud be easy enough to understand.
Oh, it was made in 2.7, and since it uses strings there'll likely be some problems with using it in 2.71. If this is a major problem, let me know & I'll post an updated version.
I know what you're thinking ... Don't think that.

scourge

i would like to compete in this competition as i will be coding my shops for my game soon, but it probably won't be done for the comp. Well anyway, i'll try and finish it.

I'll use this post also to vote  ;)

mätzyboy

I just wanted to say I think this competition is an excellent idea. The resources that will emerge from all the solutions provided makes a great base for a library of modules for other projects.

Sorry for spamming...  ::)

Babar

Wonderful entries so far, though I am still waiting for more! I thought this was going to be a flop, but apparently not.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Nikolas

Ok. a small comment for Ashen, The shop was perfect and could handle probably a lot of items.

While I was playing it, I was worried that the prices will change.

Spoiler
You know, I just bought 20 Circuit Cards B from the right merchant for 10 GP and sold them to the left one for 23 GP. I mean while I was clicking I was worrying that the left merchant would say to me. "Enough. I don't want any more", or because of the ammount he would be lowering the prices wihch he bought. That would really bring life to the game;) But it's perfect
[close]

Ashen

Nikolas: Thank you! Obviously, the limit to different items is 300 (being the maximum number of Inv Items - although, the effective limit at the moment is about 5, I realised after I posted that I hadn't included scroll buttons on the shop GUIs), I don't know whatthe limit to the number of each item is (what's the upper limit of an int? 2 million something?).

In reference to your spoiler:
Spoiler
That'd be a great idea! It's not quite possible at the moment, as I added a check to prevent prices being changed by accident (e.g. calling Shop[2].AddItem(iKey, 2, 25); when the price was already set at 20). However, it'd be easy enough to work around for anyone who wants to. Hmm, unless ...
[close]

Are we allowed to modify our code after entry ...? I mean to actually add functions, not just clean up what's already there.
I know what you're thinking ... Don't think that.

Akumayo

Ahh man!  Ashen entered... that means I'm going to lose!  Just kidding Ashen... well... not really... you are a big threat...  Good luck!   ;D
"Power is not a means - it is an end."

Babar

Quote from: Ashen on Wed 07/12/2005 14:28:00
Are we allowed to modify our code after entry ...? I mean to actually add functions, not just clean up what's already there.

Sure you are! Incorporate as many ideas as you can think of, as long as you have submitted your final entry before the voting starts.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Ashen

OK, just squeezed this in by the deadline. The source is still available a the same place (Right Here), but has new functions added for changing item costs in game. This could be used (as Nikolas suggested) to de-value something after you've sold a certain amount to the shop, e.g.:
Code: ags

if (Shop[1].CheckStock(iKey) == 0) Shop[1].ChangeCost(iKey,  25);
else if (Shop[1].CheckStock(iKey) <= 10) Shop[1].ChangeCost(iKey,  20);
else if (Shop[1].CheckStock(iKey) > 10) Shop[1].ChangeCost(iKey,  15);


It can also be used (for those who've already tried the engine) in place of AddStock(Item, 0, Cost) to set the price of something without adding to the inventory.
I know what you're thinking ... Don't think that.

Babar

Ok, times up, so if anyone else has something going on that they want to submit, they better speak up now, and perhaps the deadline can be extended. Buloght, what about you? Anyone else who hasn't spoken up? Because as it goes, there are only two (admittedly awesome) entries, and that isn't much of a competition.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

scourge

i did finish my shop system, but its not in a state to submit. Its very much integrated into my ugly game code  ;D from my RPG

Babar

Ok, considering all the enthusiasm for the idea, I'd have thought there'd be a few more entries. I'm not to sure what to do in this situation, so if Akumayo and Ashen could come up with an idea for the next competition together, everything would be nice and peachy.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Akumayo

Eh, I think Ashen's shop was way better than mine, and I'm sure a great deal of you will agree, so by Babar's idea, I give all my rights to deciding the next topic to Ashen for his lovely entry.  Get to it Ashen, I'll beat you this time!
"Power is not a means - it is an end."

SSH

But Akumayo wins the sportsmanship award!  ;D

You are Miss Congeniality!
12

Ashen

Thank you Babar and Akumayo!

QuoteBut Akumayo wins the sportsmanship award!
Agreed.

It's actually kind of ironic, in that I only really entered so it wouldn't be a one horse race, and so I have no idea what to do next (I was hoping to share duties with Akumayo, and steal his suggestions). Guess I'll have to come up with something, now. Look for it soon-ish.

QuoteGet to it Ashen, I'll beat you this time!
Well ... if I'm hosting, I won't be competing.

The time after next, though, we shall see  ...  ;)
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk