Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
    Princess Amy
  Tue Sep 27, 2016 11:58 am
User avatar
Staff

Big Dumb Guy
I think that if the game picks up I will eventually do a wholescale interface rehaul with advice from or done by a professional UI artist.

I'm a bit stuck at the moment programming wise.

I have always done my items as individual entries in a database. So:

table_items = id, user_id, item_id

This makes it very easy to use as adding or removing items is as simple as UPDATE and DELETE FROM, while checking the amount can be done with count.

But that means if you have 10,000,000 of an item, which is reasonable to expect in what is basically a RuneScape clone, you end up with both a lot of entries in the database and a lot of processing to do the count.

But I don't know which I should be doing. I could do this:

table_items = id, user_id, item_id, quantity

But then there is still one entry for each individual item_id.

Logically the best way to do it seems to be to store items in the user data table:

user_data = user_id, ..., name, etc, item_1_quantity, item_2_quantity, item_3_quantity

But then each item I add to the game will require me adding a new column, and I'd rather it be dynamic. Not easy to manage items in this way.

So what's the best way to go about this? (Probably just the table_items way above).

I'm trying to think what else I might need to store for each individual item. Perhaps I could store the date it was gained, where it was found, and other data so that the user can look this up, which might be cool? That would mean I'd have to do it the table_items way.

Does mean that I would have to:

TO ADD x OF AN ITEM:
- check if item exists
- - if exists, add one to the quantity
- - else, INSERT with quantity x

TO DELETE AN ITEM
- check if item exists
- - if exists, check the quantity is above 0
- - - if above 0, remove one from the quantity
- - - else return error
- - else return error
- else INSERT with quantity 0 to save processing later

Gah. I have sql sometimes. I wish there was a "DELETE IF EXISTS", "SELECT but INSERT IF NOT EXISTS" etc. Probably is. I should read some stuff.


...and then whichever I go with I am going to have to make a script to replace all the items people have already earned with the new format.

2259 total. Eugh.


Top Top
Profile      
 

    Xilef
  Tue Sep 27, 2016 1:26 pm
User avatar
Staff

Staff Chick

Location: UK
You definitely do not want to have an entry for each individual instance of an item. Stack them up where you can.

Problem with SQL is that it's too flat. You'd have a table that's pretty much got a column for user_id as a key, so you can grab the entire inventory of a user, and also item_id as a key so you can find an item for a specific user. You'd then have item_quantity to track multiple items.

Quote:
Logically the best way to do it seems to be to store items in the user data table:

user_data = user_id, ..., name, etc, item_1_quantity, item_2_quantity, item_3_quantity

I don't think this is the logical way to store items. This is probably the most naive way to solve the problem.

There's nothing wrong with a single entry for each item_id. You don't need an "id" column as your primary key would be the composite of "user_id" and "item_id" (you can never have a user_id with two entries of the same item_id, the quantity column does that).

Your table would look like this;
Expand to see the code.


This is UNTESTED code, I haven't done SQL in about 5 years so some of this is probably wrong, but you should get the idea.

Here's information for the "ON DUPLICATE KEY UPDATE" http://dev.mysql.com/doc/refman/5.7/en/ ... icate.html
Here's information for the "GREATEST" compare operator https://dev.mysql.com/doc/refman/5.7/en ... n_greatest

EDIT: You'd replace INTEGER for your numeric type. For the GREATEST operator to work, it needs to be a signed integer, as unsigned would underflow into a very large number.


Top Top
Profile      
 

    Princess Amy
  Tue Sep 27, 2016 1:36 pm
User avatar
Staff

Big Dumb Guy
Thanks, that makes a lot of sense.


Top Top
Profile      
 

    Xilef
  Tue Sep 27, 2016 1:44 pm
User avatar
Staff

Staff Chick

Location: UK
You could probably merge the add and subtract into a single operation too;
Expand to see the code.

-X would either create a new entry with quantity 0 or modify an existing entry, clamping to 0.
+X would either create a new entry with quantity X or modify an existing entry.

EDIT: A brief look online shows that some people are against composite keys. It may not even be supported by your SQL software. In that case, you'd need a unique id for each entry and you'd have to use the WHERE operation a whole bunch. SQL is shit.


Top Top
Profile      
 

    Princess Amy
  Tue Sep 27, 2016 2:43 pm
User avatar
Staff

Big Dumb Guy
I'll have a look. phpBB itself never uses composite keys though so I presume it's not possible.

I have done a few modules in database design and implementation, but a surprising amount of it isn't applicable to sql.


Top Top
Profile      
 

    Princess Amy
  Thu Sep 29, 2016 11:15 am
User avatar
Staff

Big Dumb Guy
Thanks Xilef, everything seems to have worked perfectly. I was able to use user_id, item_id as a primary key and to use ON DUPLICATE as you suggested.


Top Top
Profile      
 

    Princess Amy
  Thu Sep 29, 2016 11:38 am
User avatar
Staff

Big Dumb Guy
So for the marketplace, I have three columns in the primary key.

ITEMS = user_id, item_id, minimum, quantity

REQUESTS = user_id, item_id, maximum, quantity

You can have requests at multiple prices, for if you quickly want one log for 1,000 gold, but want a long term request for a million logs at 100 gold each. Each individual request is defined by its (user_id, item_id, maximum).

When somebody adds an ITEM, the game searches for any REQUESTS that meet the MAXIMUM price you have offered. If below the maximum, it performs the trade.

When somebody adds a REQUEST the game searches for any ITEMS that meet the MINIMUM price you have offered to sell it for. If above the minimum it performs the trade.


Edit: new mockup.

Image


Top Top
Profile      
 

    Nathaniel3W
  Thu Sep 29, 2016 2:11 pm
User avatar
Member

Generic Townsperson

Location: Washington, DC
Very interesting. Now I'm just thinking about how I'm going to program my high-frequency trading algorithm to snap up undervalued items and sell when someone sends out an attractive buy-order. Buying from pessimists and selling to optimists and all that.

It'll be good for the economy, I'll provide liquidity, and as a side-effect I'll make a handsome profit. :biggrin:

_________________
Check out Himeko Sutori, the upcoming large-scale tactical JRPG where you lead an army of 100 unique characters


Top Top
Profile      
 

    Princess Amy
  Thu Sep 29, 2016 2:17 pm
User avatar
Staff

Big Dumb Guy
You'll never see the offer prices for either side, so while you can do that it might take a while. You won't know that someone's selling an undervalued item, you'll just pick it up if you put an offer in and it happens to be there.

It is good for the economy though. Merchanting is important in an MMORPG. Items need to have worth.

There will be other systems at play:

- If you put a high offer (above 200% its average price) and it doesn't buy for a week, you'll automatically buy it (from a central bank)
- If you put in a low sale price (below 50% of its average price) and it doesn't sell for a week, you'll automatically sell it (to a central bank)

I am unsure how that will affect the economy however.

Any items on peoples want lists that are struggling to buy but are around the average price will spur mini quests, called Bounty Seeker, where you will be able to go and find said item and sell it to get points to use in a special store. Or something like that.

If you undervalue an item, you will get a warning message. Similarly if you overvalue a purchase price.

And finally there will be limits on how many of an item you can flip in a day (flipping meaning buying then instantly reselling).


Top Top
Profile      
 

    Xilef
  Thu Sep 29, 2016 2:45 pm
User avatar
Staff

Staff Chick

Location: UK
I'm very interested in how you handle your virtual economy.

The central bank idea sounds like it's designed to allow single-player trading at a disadvantage to multiplayer trading.
The mini quest idea sounds like a really good way to handle the problem of never finding what you're looking for. The current view on real-money transactions for games is that you pay to avoid spending the same value of your time working for the item, so this would be the reverse of that - unable to pay => work on a quest to earn your item (quest itself I would presume costs resources as well as time + a risk factor).

The value of an item in online worlds is usually dictated by the players, so undervaluing and 200% value tests could end up being beneficial to the players in weird way - or detrimental depending on how you look at it. One scenario could be quest for items without breaking budget, sell undervalued, repeat. Another scenario could be the value of an item goes up because it proves to be powerful/cool/rare, so selling at 300% becomes normal.

I've got ideas for my own game with handling the economy (more like, to never have to handle it at all) where the base item sold in the game shops probably shouldn't be sold for more than it costs in the shops, but the item can be powered up by players so the value of it increases, making it more sensible to sell it above shop value. It massively complicates things as items now become unique, so handling it online would be nuts (especially in SQL), this only works nicely for me because trades are handled between clients, with no trade-list server in the middle, that's not an option for Afar.

Are you going to have trade expiry times too? So if an item goes unsold and it's not below 50% it gets taken off the market? I think that would be acceptable if a report is given to the trader of possibly why it didn't sell (maybe store how many players saw the item and compare it against the prices of other items in its category).


Top Top
Profile      
 

    Nathaniel3W
  Thu Sep 29, 2016 3:25 pm
User avatar
Member

Generic Townsperson

Location: Washington, DC
So if you can't see what others are selling it for, how would you know how to price your own? Will you at least see a "average last 10 sales" price? Or do you only get the warning for exceeding the 50%-200% range? Also, when you place a buy order, do you have to hand over your money immediately, and it sits in escrow until the order is either filled or cancelled? If you want to buy something but you're on the fence about it, can you place a buy order at what you would buy it for, but then cancel the order and free up your money if there are no sellers at that price?

_________________
Check out Himeko Sutori, the upcoming large-scale tactical JRPG where you lead an army of 100 unique characters


Top Top
Profile      
 

    Nathaniel3W
  Thu Sep 29, 2016 3:35 pm
User avatar
Member

Generic Townsperson

Location: Washington, DC
Oh, also, does the central bank in this case actually need to have the items in stock? Or is it more of a magic bag into which items disappear and others appear? If, say, I wanted to buy the Ultimate Mega Sword of Doom, could I make an offer to buy it at 200% of the last sale price, and a week later I'll get one? If so, would that become the next last sale price?

Also, I think that showing players the offers that are out there will help with quite a few things: I think players will appreciate the transparency. I think they'll be able to make better decisions on pricing, thus narrowing the margin, and no one gets ripped off. It can also affect their decisions on what to farm: If I see that the price of lumber is up and iron is down, I'll spend my time farming lumber instead of iron.

_________________
Check out Himeko Sutori, the upcoming large-scale tactical JRPG where you lead an army of 100 unique characters


Top Top
Profile      
 

    Princess Amy
  Thu Sep 29, 2016 10:52 pm
User avatar
Staff

Big Dumb Guy
Players will see three averages:

1. The average price people in the system are asking for
2. The average price people in the system are selling for
3. The average price the item has actually sold for over a period of time (weekly graph)

They will not see individual trades.

So for example if ten people are selling at 100 gold and ten selling at 50 gold, the player sees the average of 75 gold.


Top Top
Profile      
 

    Princess Amy
  Sat Oct 01, 2016 10:27 pm
User avatar
Staff

Big Dumb Guy
I have now added an intro scene to the game, so that I have somewhere to inject some news before the player plays (as I want to keep the actual game homepage uncluttered). There isn't very interesting news to show yet though so it's largely placeholder stuff.

Image


Top Top
Profile      
 

    Princess Amy
  Sun Oct 02, 2016 2:47 pm
User avatar
Staff

Big Dumb Guy
Progress on the marketplace so far.

Image

Nearly done.


Top Top
Profile      
 

    Princess Amy
  Mon Oct 03, 2016 2:33 pm
User avatar
Staff

Big Dumb Guy
The marketplace is now fully implemented. The only problem is that instead of performing the trade, it seems to add 15430903 to the quantity on each side. I have no idea why.

yay!


Top Top
Profile      
 

    Princess Amy
  Tue Oct 04, 2016 2:12 pm
User avatar
Staff

Big Dumb Guy
Merchant's Marketplace

The Merchant's Marketplace is now implemented. You can't access it yet (there's no need to at the moment as there's nothing really to buy and sell).

Image

Please ignore the missing item icons, I forgot that part. Will fix now.

How it works

So you've been traveling and you've accumulated a lot of junk. You have 50,000 pieces of wood but you're no woodworker yourself. You need to offload them on an unsuspecting adventurer and flee.

You go to the marketplace and you put a "want to sell" offer.

The items are removed from your inventory and enter the system. If they match with somebody's buy offer they instantly move to their inventory and you gain an amount of gold.

Likewise, you can place a buy offer, and the same happens.

Minimum/Maximum

You set a minimum price that you want to sell your item for. You will get at least this price.

Your opponent sets a maximum price they are willing to pay for the item. They will pay no more than this price.

The item will go for the middle ground. Any spare gold goes back to the player (so if the item went for 5 gold but they said they'd pay up to 6 gold, they get 1 gold back).

Removing items from the system

As long as your trade hasn't performed yet, you can click the (missing) icon to remove your item from the system, or your buy offer and get your items/gold back.


Top Top
Profile      
 

    Princess Amy
  Tue Oct 25, 2016 12:55 pm
User avatar
Staff

Big Dumb Guy
Image

Image


Top Top
Profile      
 

    coyotecraft
  Fri Oct 28, 2016 4:12 am
User avatar
Sponsor

Big Dumb Guy
Does the voice bubble move around? Change sizes? I would suggest keeping the 'next' button to a stationary position, like the bottom corner, regardless of where the bubble is on screen.
That's something I hated about interactive flash things, . The button is here, then over here, now down slightly. It made reading it really slow to progress. The text is short enough to read instantly, but your cursor or whatever has to move to a new position after every short phrase.


Top Top
Profile      
 

    Princess Amy
  Thu Jan 19, 2017 1:02 pm
User avatar
Staff

Big Dumb Guy
Introducing the cast.

Image

I am trying to create a tutorial which tells you enough to be a viable tutorial, while still giving you a taste of the story and feel of the game.

I've settled with Kendra, left, being one of the "bandits". You enter the world practicing things with a bandit, and then explore the towns that they're capturing and burning.

During the tutorial something happens which leads you to think the courtship are the bad guys, but then you're quite clearly shown that the bandits are the bad guys. The general point being that "bad guys" is subjective and nobody is perfect or completely evil.

Middle is Princess Amy, Princess Consort of the town of Tiben.

Left is an unnamed Wizard, I haven't got that far yet. I think she's Merlin though. Possibly.

Kindof turned her into a battler. It sucks.

Image

The tutorial will look something like this with cutscenes and tasks inbetween.

Image

This is her sprite and setting:

Image


Top Top
Profile      
 

    Princess Amy
  Thu Jan 19, 2017 5:39 pm
User avatar
Staff

Big Dumb Guy
Desert town names..

Jusascus
Al'Telya
Tamarra
Juswait
Isworfit


Top Top
Profile      
 

    Jason
  Fri Jan 20, 2017 1:16 am
User avatar
Awesome Bro

Generic Townsperson
The woman in blue, her skin colour changed since October... guessing she took time off wizard work to get a nice tan? :thumb:

_________________
This is a block of text that can be added to posts you make. There is a 9999 character limit.


Top Top
Profile      
 

    Princess Amy
  Fri Jan 20, 2017 1:51 am
User avatar
Staff

Big Dumb Guy
Yeah she's been sunbathing it up in Al'Telya.


Top Top
Profile      
 

    Princess Amy
  Sun Jan 22, 2017 3:22 pm
User avatar
Staff

Big Dumb Guy
I alluded earlier that Princess Amy is not the leader of the land but is Princess Consort.

That's because this is Queen Esmerelda.

Image

Image

Image

Been trawling through the makers and resource packs I own, some community resources and my own edits and have picked out the first few enemies which look nice in this game window size. I just want to give a sense of scope to my plans for the game.

Image

And these will be my desert characters.

Image


Top Top
Profile      
 

    Princess Amy
  Mon Jan 23, 2017 1:48 pm
User avatar
Staff

Big Dumb Guy
So, two expansions.

Recipes for metalwork. (You can buy a hammer from the Port for 5 gold) - Number is your metalwork level.

Image

And 17 of the above enemies added. Need to create movement patterns for them.

Image

We also have new music, from the RMN Music Pack and the Classic Fantasy resource pack.


Top Top
Profile      
 

    bacon
  Mon Jan 23, 2017 1:57 pm
butts n booties
User avatar
Staff

Sewer Rat
I really like what you are doing with the battlers. Are you making them from scratch or doing edits?

Great job Amy

_________________
Art Blog
Art Thread


Top Top
Profile      
 

    Princess Amy
  Tue Jan 24, 2017 1:55 am
User avatar
Staff

Big Dumb Guy
Edits.

Image

Tomorrow I think we'll see recipe books and armour crafting, getting lots of work done while I procrastinate over the tutorial...

I need a book store.

Blacksmith Basics by AA Kiln
Armour Trimming by Jane Usetin
Nulenvojd Armour by Nordic Mailer
Beginner Woodwork by Margaret Cutwood
Colourful Capes by John Stainback

Each book has a couple of pages explaining the basic principle of what you're making, then provides some recipes you can click to make.

As an example:

Corinthian Armour
Ingredients: Steel x 6, leather x 2, Corinthian Bronze x 1 for trimming

Armours adding tomorrow: Bronze, Iron, Steel, Trimmed (amalgam), Spectral (bismuth trim), Corinthian, Nulenvojd (Nordic gold trim).


Top Top
Profile      
 

    Princess Amy
  Thu Jan 26, 2017 2:03 pm
User avatar
Staff

Big Dumb Guy
I should stop saying "tomorrow I'm going to x" because invariably it never happens and I get sidetracked.

Some updates.

Theme Tune

We now have a main theme tune, from the RMN Music Pack, which can be heard from the login screen.

Inventory Cursor Tooltips

You can now see the names of the items when you hover over them.

Inventory Tabs

Inventory is tabbed for future use. Currently one tab shows you your merchant skill levels.

Miner has been renamed Metalwork.
Lumberjack has been renamed Woodwork.
A future planned skill is Hunter Gatherer, which will include picking farm items, fishing, trapping animals and various things like that.

Some new enemies to fight around there.

In Progress - Not Completed

New Maps

Three new farm maps added. Haven't done the upper layer yet mind,

Recipe Books

These are similar to in... Final Fantasy VIII I think? Basically you have a list of items you can create and their ingredients, click to make them. Not yet implemented, half way.

Armour Creation

Implemented but you can't access it until recipe books are done.

Battle Stats Reform

I am reworking how battle stats work and equipment and enemy stats, so don't worry if enemies currently feel unbalanced. It's on its way.

Dynamic Signatures

Half done. Will look something like this, possibly with some more stats. This was a feature of Old Afar.

Image

Previous game looked like this:

Image

That's a real player by the way, I plucked it at random, happened to be called John Doe!

Currencies

Community points store, etc.

Marketplace

A few things to tweak and it'll be out. I need to work out how and when it can be accessed. Could just be a menu window.

Why is everything all over the place?

I'm suffering from some kind attention thing at the moment due to severe lack of sleep so I am finding it very hard to focus on anything.

If I could just settle down properly for a day all this would be done.

I also need to add: new enemies, merchants, shops in Tiben Town, and new mining spots.

I just need to have a day where I can properly get down and dirty :mad: right now I just cannot concentrate at all.


Top Top
Profile      
 

    Nathaniel3W
  Mon Feb 13, 2017 12:35 pm
User avatar
Member

Generic Townsperson

Location: Washington, DC
Yeah, FFVIII had the recipe books. I think in my whole playthrough I upgraded maybe one or two weapons. There was always one ingredient I just never found. That game was a real slog for me, for about a dozen reasons. Anyway, I love the idea of crafting recipes. Please make the ingredients possible to obtain.

The dynamic signature looks great.

_________________
Check out Himeko Sutori, the upcoming large-scale tactical JRPG where you lead an army of 100 unique characters


Top Top
Profile      
 

    Princess Amy
  Tue Feb 21, 2017 2:41 pm
User avatar
Staff

Big Dumb Guy
Since I've got to change a lot of stuff anyway I thought I'd look into changing the resolution of the game.

This is at 1000x680. Reason? Fits in a browser window on a 1024x768 screen.

Image

Image

of course it would be nice if it was dynamic but I don't know how feasible that is.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next


Who is online

Users browsing this forum: No users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group