Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Design advice for strategy/RPG game  (Read 4202 times)
0 Members and 1 Guest are viewing this topic.
Offline Orko

Junior Newbie





« Posted 2012-08-22 15:08:11 »

Hello forum, I'm new here. Was doing java development a number of years ago but has been out of it for too long and I'm now considering to start a little game project to get back in.

The plan is a turn-based strategy game with some RPG elements. You manage a smaller group with skills & personalities. There will be lots of items and resources. A lot of the challenge will be resource management and time management for your characters.

The game will be 2d and most things happen through selecting different options in events, moving around inventory and setting tasks to be completed. There will actually not be much graphics at all to begin with, I'm planning on using the Netbeans GUI builder to get most of the interface done

But there will be a lot of detailed simulation going on. You should have different tasks available to choose for your characters, for example to build something, but this will require tools, materials, skills etc. It all fits quite well into a nice OO structure with inheritance from less specialized object types etc.

But with my rusty java skills I'm still a bit confused about how to best go about this. For example, there will be a lot of possible tasks to do, but the selection needs to be limited based on character skills, tools available, raw materials etc. Some tasks will be unique, some can be repeated but they will all have different criteria for being selectable or not. What is the best approach here, do I keep task objects in a big list to iterate over every turn and ask each object if they are "selectable" based on the current world state or is there a smarter way?

The task selection is a good example of a problem that is coming up a lot in my design. I basically want to handle groups of object based on their properties (which could also change), but not have to keep the full objects in memory. Using a SQL backend would go a long way to help with the selection, but would introduce a few other complications and might be a bit overkill if there is a better way to do this.

I would be grateful for any general advice or pointers to similar examples.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #1 - Posted 2012-08-22 15:36:39 »

How many of these objects are we talking about?  Dozens?  Thousands?
Offline Orko

Junior Newbie





« Reply #2 - Posted 2012-08-22 15:50:50 »

Let's assume 100-200.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 202



« Reply #3 - Posted 2012-08-22 16:11:27 »

That's nothing.  Just keep them in memory, or at least the relevant properties (images I suppose you could lazily load), and iterate over them every turn.
Offline Ultroman

JGO Knight


Medals: 25
Projects: 1


Snappin' at snizzes since '83


« Reply #4 - Posted 2012-08-22 19:09:40 »

Well, with the wide variety of tasks you want, and the completely free allocation of requirements for them to be available, at first glance you'll be stuck at iterating through a list of all of them and check each one for availability.

I'd probably divide the tasks into a few lists. One with tasks that require item-stock or something that changes all the time, and a list with the ones that only change with skill-availability. The latter one will only be iterated through when a change in chosen skills happens e.g. when a character has levelled up and has chooses a new, or upgrades an existing, skill.

It really depends on how many tasks you're going to end up with. Iterating through 200 tasks won't take any time at all, and as long as you make sure it doesn't have to run through the entire availability-validation algorithm every time you should be fine even with thousands, but make it able to stop whenever it finds a reason why the tasks should NOT be available. If you end up with, like 15000 tasks, you should probably think up some system of dividing them into separate lists, otherwise I wouldn't worry about it.

- Jonas
Offline Orko

Junior Newbie





« Reply #5 - Posted 2012-08-22 20:44:43 »

Thanks, you are right of course that the iteration model should be fine here. Even if I have to iterate again for each object to check against a number of properties the check will not be that heavy. This will also give me the best flexibility to handle any special cases.
Offline Best Username Ever

Junior Member





« Reply #6 - Posted 2012-08-23 01:30:34 »

You're talking about a turn based game? Even if it took milliseconds to complete the task, would that even be a problem? Would any of your players complete a turn that quickly, even with animations turned off?
Offline Orko

Junior Newbie





« Reply #7 - Posted 2012-08-23 14:48:56 »

Most of the calculations and updates of things to display in the GUI cannot be done until the player clicks "end turn" button. Of course I want to minimize the waiting time between turns, but as you say we are not really talking about noticeable differences so yes I was probably overengineering it.

I expect the amount of objects & calculations to grow over time if I keep working on the game and expand it further, especially with easy things like adding more items, so I was afraid I would lock myself into a design that would at some point limit the expansion possibilities.
Offline Damocles
« Reply #8 - Posted 2012-08-23 16:02:20 »

Looking at you planed gamedesign, you will not run into any performance problems.
Its really the least of your problems.

A special case goes to how the AI is contructed.
And I mean not a simple statemachine, but AI Agents with some massive planning and search strategies.

But event then, its only going to impact realtime strategy games.
in a turnbased game you can arrange everything pretty unoptimized. (even a500ms delay to calculate a turn will not bother any player here)

Choose a system wich is easiest to implement, extend and not loos oversight of. Dont bother about logic performance in this gametype.
Its not going to determine if the game is good or bad.

Offline _Scyth_

Junior Member





« Reply #9 - Posted 2012-12-29 16:23:59 »

At the beginning after the user has chosen their starting skills or whatever you could iterate over your list of tasks, and add the ones that are available to a separate list, then you can display the contents of this list as the available tasks.

Then everytime, the user levels up, or a new skill is chosen, or gains more materials, you simply re-run the method containing the iterate code.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (72 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (43 views)
2014-09-07 01:13:42

Longarmx (27 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!