Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Discussions / Miscellaneous Topics / Re: Swine flu... on: 2009-04-28 18:54:32
Er... someone should point out that WHO has said no such thing.

Most recent information from their website-

"The Director-General has raised the level of influenza pandemic alert from the current phase 3 to phase 4.

The change to a higher phase of pandemic alert indicates that the likelihood of a pandemic has increased, but not that a pandemic is inevitable."
2  Game Development / Game Play & Game Design / Inventory System on: 2009-04-26 18:21:38
Time to re-factor the old inventory system in my MUD to something a bit more principled. At the moment it is composed of two types of classes:

WearEvent, PutEvent, DropEvent, etc. etc. - Events which represent the movement of an Item from one location to another, at present these simply identify whether the target in question is visible/exists, and that it is an item. They then call methods inside of...
Inventory - A god-class with too many responsibilities. Contains enum Location for all locations an item can be worn/held. Used in a HashMap<Location, Item> which is manipulated through various methods that are extensions of the events mentioned above. EG: Inventory.drop(Item) etc. etc.

My primary issue is that in a text-based game you have to tell the player very specifically why the command they entered failed, whereas in a graphical game you can play an 'error beep' and trust that the player understands that he can't wear a health potion on his head. So what I have is error messages entrenched very far past the above-mentioned events, within Inventory itself: 'You are already wearing something in that location', 'You don't have enough room to carry that', 'Your hands are full,' etc.

Any suggestions? I could just re-factor all logic and accompanying error messages into the events themselves, or create intermediary events which handle secondary logic beyond type-checking, but in either case I can't help but feel like I'm missing out on a more elegant, principled solution. This one is very seriously programmed to an implementation, as opposed to an interface.
3  Game Development / Newbie & Debugging Questions / Re: Giving orders from a core loop on: 2009-03-31 19:39:17
I think you're right, actually. Often times I find myself operating under the notion that giving two different modules two different call stacks, that they receive more attention than they would in a single call stack. In other words, that the two stacks are truly operating simultaneous to one another. The reality is, I think, that I'm just introducing synchronicity issues.

Okay, here's what I have for a core loop at the moment. If anyone can think of other generic MUD server functions (outside of specific architectural solutions) please let me know. Any and all feedback very much welcome.

Core Loop*
Check for incoming network connections
Monitor existing connections (Manage disconnect... hrmm should input be sent to players here? Or at end of loop?)
Player refresh (get input, create actions, update status)
MonsterBehavior (create actions, update status)
ProcessActions (Game logic to create event objects of some sort)
Publish narratives(send input to players)

*Each line represents a class or group of classes
4  Games Center / Archived Projects / Re: Test my platformer engine (WIP) Mac-testers appreciated! on: 2009-03-30 20:12:51
Windows 7 Beta
Intel Pentium Dual CPU T2370 @ 1.73 / 1.73 Ghz
2 GB RAM
GeForce 8600M GT


- ~55-60 constant fps. I tried all sorts of key-spamming to get this to go down. Never did.
- ~35-40% processor usage
- Log attached
- It's got some style Smiley
5  Game Development / Newbie & Debugging Questions / Giving orders from a core loop on: 2009-03-30 07:29:32
Hey All -

I'm creating a core server loop for my MUD that will command various modules of the game (each presumably running on their own thread) to refresh themselves. For example, the core loop would contact an actionsStack module and tell it to process a certain number of actions, contact a mobList module and tell it to command each mob to tick (retrieve actions, check if spell durations are up, lose health if bleeding, etc.), perhaps check on a newPlayerConnections module, maybe sleep, and then start all over.

My intention behind encapsulating all of the above functionality into various modules is that the core loop need not hang on any particular resource-intensive process, thereby delaying other processes.

A) Is this a reasonable solution to the problem?

B) If so, what is the best way to code a 'refresh' order from the core thread to secondary module threads? My first thought is to create a volatile boolean named refreshed, and have it set to false by the core thread. And the secondary thread would just loop while(!refreshed) {    doStuff;    }

Cheers.
6  Game Development / Game Play & Game Design / MUD 'action' objects on: 2009-03-23 21:25:17
Currently I'm working on a MUD as a hobby. Every 'action' in the game is implemented via abstract class Action and concrete sub-classes, like "Put", "Attack", "ChangeStance", etc.

I'm looking for suggestions on the design. It currently works, and is relatively open for expansion, but it just seems... messy. The architecture is especially messy in regards to sub-classes of Action which deal with Inventory functions.

These Action sub-classes contain three primary components:

- static ActionResult instantiateAction(String input) : This is called using reflection(so it has to be static)on the server, when a client enters a command that corresponds to this Action. The string is entered into another object which returns a Targetable object. If a Targetable object cannot be found, or if the object is not of enum TargetType.ITEM, then an ActionResult is returned with an error, the error is sent to the client(IE: "You can't pick that up, it's a monster!"), and the Action object is not created.

- Constructor(): createNarratives(), a private method, is called here in order to produce descriptions of the actions, which are in turn sent to clients. The action itself is also placed on the player's actionStack to be performed.

- initMechanics(): This is called when the action is actually performed from a mob's actionStack. As part of these particular sub-classes, an inventory function is called like Stow(Targetable), which can assume that what its getting is an item and isnt null, but not things like whether or not the item is in hand for stowing. Therefore this too returns an ActionResult which is checked for errors. If it has errors, then createNarratives() is called again, and its original (successful) narratives are replaced with an error. (IE: That item is on the ground. Pick it up first.)

Like I said, not the worst architecture in the world, and it works, but we ARE talking about a lot of eggs in one basket: recognition and response to client's text entry, narrative creation and error messaging, and actual nuts and bolts mechanics. (Although the latter is fairly well encapsulated into the Inventory object, this is not the case with most other Action sub-classes. Most of them contain about 25-30 lines of mechanics code. This provides for a TON of customizability in action specifics, but only because the developer is forced to work really low-level at all times.)

Thanks for any suggestions/feedback!
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

pw (37 views)
2014-07-24 01:59:36

Riven (38 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (50 views)
2014-07-17 23:47:54

danieldean (42 views)
2014-07-17 23:41:23

MustardPeter (44 views)
2014-07-16 23:30:00

Cero (60 views)
2014-07-16 00:42:17

Riven (57 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!