Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (794)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
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 9705 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 Devvie

« 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 Devvie

« 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  

hadezbladez (3114 views)
2018-11-16 13:46:03

hadezbladez (1126 views)
2018-11-16 13:41:33

hadezbladez (3074 views)
2018-11-16 13:35:35

hadezbladez (615 views)
2018-11-16 13:32:03

EgonOlsen (3902 views)
2018-06-10 19:43:48

EgonOlsen (4373 views)
2018-06-10 19:43:44

EgonOlsen (2606 views)
2018-06-10 19:43:20

DesertCoockie (3427 views)
2018-05-13 18:23:11

nelsongames (3548 views)
2018-04-24 18:15:36

nelsongames (4589 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45 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‑
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!