Game played over weeks - am I being too ambitious?

Discuss game development design and post your game ideas

Post » Mon Mar 25, 2013 7:14 pm

That is awesome.

As awareness of C2's capacities spread, I think we are going to see it used in more and more non-game applications.
B
13
S
2
Posts: 30
Reputation: 1,272

Post » Wed Mar 27, 2013 12:19 pm

Thanks for all the replies and support guys! What I'll definitely do is create a few games first before I get onto my big complex game! By the sound of it, the way I want my game to work is similar to @theubie's
B
12
S
2
G
3
Posts: 86
Reputation: 2,955

Post » Wed Mar 27, 2013 9:40 pm

Let me know if you run into any issues. I'd be happy to lend help as I can.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Thu Aug 08, 2013 11:30 pm

Thanks @theubie, and sorry for the late reply but I'm going to take you up on your offer of advice! You say you're working on an MMO that uses a C2 frontend, and php/mySQL backedn, well that's what I'm working towards too. But right now I'm trying to figure out how to create RPG quests.

Like a typical sort of RPG my game allows a player to talk to NPCs and get quests, some of which have sub-tasks. How do you keep track of which quests you have, and which NPCs you've already talked to?
B
12
S
2
G
3
Posts: 86
Reputation: 2,955

Post » Fri Aug 09, 2013 4:09 am

[QUOTE=onion] Thanks @theubie, and sorry for the late reply but I'm going to take you up on your offer of advice! You say you're working on an MMO that uses a C2 frontend, and php/mySQL backedn, well that's what I'm working towards too. But right now I'm trying to figure out how to create RPG quests.

Like a typical sort of RPG my game allows a player to talk to NPCs and get quests, some of which have sub-tasks. How do you keep track of which quests you have, and which NPCs you've already talked to? [/QUOTE]

I use an array and then I have a google docs spreadsheet for my own reference. Everything in the 0 column pertains to the status of a certain quest. Everything in the 1 column pertains to each NPC, for instance, and whether you have talked to them or not. For my quests I set at 0,2 to 0 if the quest is open, 1 if you are currently in it, and 2 if it is completed (and so on for all of them). You can do something similar for NPCs. I also use different array cells for inventory management, though my inventory is simpler than in many RPGs. You can then output the whole array AsJSON and upload it wherever or however you want (I store it on clay.io and then retrieve it for loading).
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

Post » Tue Aug 13, 2013 6:07 pm

@C-7 So although you do have an online storage, all the quest logic is stored locally, correct? I haven't had chance to play your game, but I assume it has the player character walking around, talking to NPCs and getting quests. I presume the logic is something like:

Talk to NPC
Check if you already have this quest
Display dialogue
Add quest to array

Then if you chat to the NPC again it'll show different dialogue like "have you completed the quest yet" etc.

It's the logic of this that I'm struggling to get my head around. I'd love to see a good example. I don't want to have the verbose process of creating individual logic for every NPC that does the same checks each time. Or am I just asking for trouble and should do it the time-consuming way?
B
12
S
2
G
3
Posts: 86
Reputation: 2,955

Post » Wed Aug 14, 2013 3:45 am

@onion

I apologize in advance if the image is huge. I store the state of someone's data online once you save, but everything else is handled locally. I have a dedicated slot in my array for each quest. I also have a private variable for each npc if I want them to rotate through a few sayings. In this example, I'm showing how the status of the quest that pertains to this NPC changes what they say or what actions happen.



My array, called Inv is what we're looking at. At 0,7 is the quest for this person. For all of my regular quests, 0 means it is available, 1 means it is currently in-progress, 2 means it is complete.

I also have a check if the NPC is within range (it sets them to "Active = 1" if they are). I have an invisible rectangle with an id variable that references each npc, then I set the visuals for them to that position. I also check the "Speech" layer opacity so it won't let you open up another conversation if one is currently open. In the first event, if 0,7 is 2, then it shows a message if you've completed the quest. I have subevents that test if a certain story element is running or not, too. The second event runs if the quest is open and starts the dialogue for if you want to accept the quest.

Just so you can follow it all, if Speechon = 1, it fades in my speech layer. There is a triangle "Play" button that progresses. There is a variable on there called "more". If it is 0 and you hit the play button is sets Speechon to 0 and fades it back out. If more = 1, it doesn't.

I know there's a lot there, but you only have to write that once and then copy-paste and switch numbers/text for the rest of the NPCs. I'm sure someone may have some more elegant solution, likely using functions, but I really like being able to follow as much as possible right there.

But I hope that example helps!
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

Post » Wed Aug 14, 2013 8:27 pm

The other possibility I'd use, @onion: since you're using MySQL on the back end...when a PC talks to an NPC, you send a query back to your php with the NPC's id. Your php can look up a table with the players' id and the NPC's id to figure out if/when your've talked to them and what step a quest might be on (could hold the quest in another table...you can make as many db queries as you need). It could figure out what the NPC should say and return a the text along with a list of options the player can choose.

Present those to your player and send his response back as another query. Repeat until the conversation is done.

Obviously it would require more knowledge of php/MySQL than C2, but it would have the advantages of:

1) Being more secure. While most people won't monkey with your client code, someone's going to play with it at some point.
2) Keeping your client size smaller. Storing massive amounts of data on potential NPC conversations plus the logic to handle them on the client side will require the client to have to download all that data/logic, where as the server only has to send just the specific responses needed at the time.
3) Possibly more efficient. Most servers can run php logic scripts and db queries way faster than a client's machine can, and MySQL is optimized for this kind of work while the C2 array hasn't quite been around as long. (Not knocking Ashley and the gang, though...it's just that THIS is what MySQL was made for)

Both methods would work, however, so go with what works for you.theubie2013-08-15 02:47:50
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Wed Aug 21, 2013 10:24 am

Thanks very much @C-7, it's great that you've shared your code! Your solution is sound, but have a niggling worry about the amount of duplication you've got if you have similar code for each NPC. Although it's not much of a problem as long as you don't need to change it.

@theubie I'm glad you've told me about this solution, it's what I've had in my head actually. I'm very familiar with mySQL, so this wouldn't be a problem. It essentially makes C2 the frontend and store the logic elsewhere. A bit like a webpage actually.

As a webdeveloper, this makes sense to me!
B
12
S
2
G
3
Posts: 86
Reputation: 2,955

Post » Wed Aug 21, 2013 3:16 pm

[QUOTE=onion] Thanks very much @C-7, it's great that you've shared your code! Your solution is sound, but have a niggling worry about the amount of duplication you've got if you have similar code for each NPC. Although it's not much of a problem as long as you don't need to change it.

@theubie I'm glad you've told me about this solution, it's what I've had in my head actually. I'm very familiar with mySQL, so this wouldn't be a problem. It essentially makes C2 the frontend and store the logic elsewhere. A bit like a webpage actually.

As a webdeveloper, this makes sense to me! [/QUOTE]

It's a trade-off. I could do it as a function and save on the duplication, but it would make special circumstances more difficult. I like being able to list the conditions right there because there are plenty of instances where you would want things different. As far as where you store the actual text, it makes no real difference whether it's in a database on your server or in your C2 code. I would just as soon make it easier on yourself and include it in your C2 code--I would hate to have to adjust the message length to make it fit correctly each time in your database. I would definitely not worry about file-size if you are. Minified, my game is just over 2MB plus graphics (which brings it to around 30MB). If you're worried about speed, I would spend your time being efficient with your graphics.
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

PreviousNext

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest