Best practice game design

Having decided to use java to develop what will be for the most part a 2D (overhead) tile-based RPG game I'm wondering what the best practice is for designing a game like this.
At the minute I'm intending on using a 'state' system, varying game states (main game, shop, battle, world map etc., state transitions and single use states to create further immersion in the game) implement a State interface that defines how the main game engine interacts with the state (mainly a tick method called on each game loop). When the program wants to switch the game state it makes a call to the main engine, something like setState(State).
Has anyone written an RPG along these lines? What kind of memory usage did you have, and did you encounter any problems along the way with this design?

So far, I've identified two perspectives.
The first is to consider yourself as a sort of "overmind" that tracks each object within the game as a seperate entity. The primary advantage seems to be that it is trivial to add objects as you go along. The primary disadvantage is dealing with all the message passing.
For example, say you are fighting a horde of goblins when a dragon flies overhead and breathes fire on the battlefield. You would have to call each goblin instance, and have that particular goblin check to see if it dies, and if so, call its death routine. You would have to call your own player object, and have it check to see if you are carrying potions. Each potion then would have to check to see if it boils and explodes in reaction to the dragon breath. And so on. But it would be trivial to add an orc to the battle, or change the dragon into an evil wizard.
This consumes quite a bit of memory (for all the objects and references), and it can be a little tricky incorporating it into the game loop.
The other aspect is to code the player as the "center of the universe" and everything happens with respect to that player. It becomes easier find relevant objects and interact with them, but it becomes much harder to just drop an object in place.
Using the prior example, the dragon becomes your combatant. Damage is done to a goblin in the array and it dies. The next enemy in your array dies. Do so much damage to your inventory and remove them as appropriate. Keeping track of what's going on appears to be much more straightforward, but it would be harder to add the evil wizard to the mix.
This consumes less memory - the game is only worried about things that happen around you as opposed to well... a whole bunch of "entities" at the same time, and is significantly faster and easier to add to the game loop.
State machines tend to follow this approach, event driven games tend to follow the prior approach.
Obviously, I don't code games for a living. I would think that most games these days are somewhat of a mish-mash. Use a basic state machine as in the FF7 example to keep track of broad activities, and within each activity, let the objects manage themselves in response to events.
For example, each game tick could switch among movement activities, "peaceful magic" activities, battle activities, clean up activities (such as death and xp rewards), and finally general inventory and shop activities, skipping steps as appropriate.
And say within the movement event, you could have an monster object scream and add itself to the battle mode queue if it detects your player object within such and such a distance.
Anyway, I've been toying with the idea of coding or volunteernig to work on an RPG as well, so I'd be interested in hearing from you guys on how to organize things too.

Similar Messages

  • Best Practice for Designing Database Tables?

    Hi,
    I work at a company for tracking devices (GPS Devices). Our SQL Server database is designed to have a table for each device we sell, currently there is 2500 tables in our database and they all have the same columns they only differ in table name. Each device
    sends about 4K records per day.
    currently each table hold from 10K records to 300K records
    What is the best practice to design a database in this situation? 
    When accessing database from a C# application, which is better to use, direct SQL commands or views? 
    a detailed description about what is best to do in such scenario would be great. 
    Thanks in advance.
    Edit:
    Tables columns are:
    [MessageID]
          ,[MessageUnit]
          ,[MessageLong]
          ,[MessageLat]
          ,[MessageSpeed]
          ,[MessageTime]
          ,[MessageDate]
          ,[MessageHeading]
          ,[MessageSatNumber]
          ,[MessageInput]
          ,[MessageCreationDate]
          ,[MessageInput2]
          ,[MessageInput3]
          ,[MessageIO]

    Hello Louis, thank you so much for your informative post. I'll describe in detail what situations I came through my 9 months of work in the company (working as a software engineer, but I am planning to take over database maintenance since no one is maintaining
    it right now and I cannot do anything else in the code to make it faster)
    At every end of the month our clients generate report for the previous month for all their cars, some clients have 100+ cars, and some have few. This is when real issue start, they are calling their data from our server through internet while having 2000
    unit sending data to our server, they keep on getting read time out since SQL Server gives priority to insert and hold all select commands. I solved it temporary in the code using "Read Uncommitted" once I initialize a connection through C#. 
    The other issue is generating reports for a month or two takes lots of time when selecting 100+ units. Thats what I want to solve, the problem is the one who wrote the C# app used hard coded SQL Statements
    AND
    the company is refusing to upgrade from SQL Server 2003 and Windows Server 2003. 
    Now talking about reports, there are summary reports, stops reports, zone reports ..etc most of them depend usually on at least MessageTime, MessageDate, MessageSpeed, MessageIO and MessageSatNumber.
    So from your post I conclude that for now I need to set snapshots so that select statements don't get kicked out in favor for insert commands, but does SQL Server automatically select from the snapshots or do I have to tell it to do so? 
    Other than proper indexing what else I need? Tom
    Phillips suggested Table partitioning but I don't think it is needed in my case since our database size is 78GB
    When I run code analysis on the app, Visual Studio tells me I better use stored procedures, views than using hard coded Select Statements, what difference will this bring me when talking about performance?
    Thanks in advance. 

  • What are the best practice to design Dashboard?

    Hi Friends,
    What are the best practice to design Dashboard?
    Thanks

    1) Use section name instead of Title View to name your report. This way sections can be collapsed and user can still see report name.
    2) Enable alternate coloring in tables and pivots for easy readablity and set table and pivot widths to 100% (for reports in dashboards) to reduce white space and achieve a more "professional look."
    3) Use column selectors and view selectors to reduce the width of reports and reduce the amount of columns user sees to a "practical minimum."

  • Best practices to design OWB Process Flows

    Hi All,
    I am using OWB to develop historical data warehouse. For this I have created few mappings that load data from source tables to staging tables and then from staging to target tables.
    Now I am designing process flows to execute these mappings. Can someone suggest me what are the best practices to design process flows?
    I have few questions in my mind that I am looking answers for:
    1) Should I keep the mapping to load staging and target tables in different process flows or in one?
    2) Do I need to include an email activity for each mapping failure or in other words how can I integrate all mapping errors in one email?
    3) I am using two outgoing transitions from each mapping; one for success and another unconditional, is that right method or I should use three transitions one for success, one for warning and one for error?
    4) I have created some email activity templates that I am using in process flows. For development environment I have used test from_address and to_address. But when I actually deploy these process flows in production, these addresses will need to be changed. Will I need to change these address individually in each process flow or in other words what is the best way to deploy process flows?
    I am using 10gR2 database and OWB.
    Any help will be appreciated.
    Thanks,
    VKumar

    Any help will be appreciated.
    Thanks.

  • Best practices for "designer - developer" interaction in Flex Mobile

    Hi,
    I'm starting development of a mobile software application and Flex Mobile is the platform I've chosen for that.
    What is the best practice / recommended workflow for designer-developer interaction? For example in web application the designer provides HTML/CSS templates to the developer which integrates them in the Web Application. What is the analogue in Flex Mobile? What should I request as input from the designer?
    I'll appreciate any hints, links, advises or previous experience on the topic.
    Thanks!
    Best Regards,
    Dinko

    If you're using Adaptive Web Design (CSS3 media queries), you can maintain one site with CSS Layouts optimized for different device widths.
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-queries.html
    jQuery Mobile
    http://jquerymobile.com/
    If you're actually running separate web sites for mobile and non-mobile devices, have a look at this recent discussion:
    http://forums.adobe.com/message/4177360#4177360
    IMO, there is nothing wrong with providing links for mobile and non-mobile users to choose which site they would prefer to use -- especially for tablets who may have an interest in both.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Best practice MPLS design/configuration for small service provider

    We are a small regional service provider and did not have MPLS supported on our network.  To start supporting MPLS, I’d like to get opinions and recommendations on the best practice configuration. 
    Here is what we have today –
    We have our own BGP AS and multiple /24s.
    We are running OSPF on the Cores and BGP on the Edge routers peering with ISPs.
    We peer with multiple tier-1 ISPs for internet traffic. We do not provide public transit.
    What we want for phase one MPLS implementation –
    Configure basic MPLS /vpn functionality.
    No QoS optimization required for phase 1.
    We have Cisco ME 3600X for  PE. Any recommendations will be appreciated.

    Not sure what kind of devices or routers you have in your network but looks for if you have support for labeled multicast for MVPN support. That will avoid other complexity of using other control protocols (like PIM) in core.
    PE redundancy can be obtained by BGP attributes, CE-PE connectivity can be tunned using IGP or VRRP/HSRP...
    You can have mutiple RSVP TEs for various contract traffic and you can bind various kind of traffic to different RSVP Tunnels based on contract or service with your customer.
    RSVP-TE with link/node protection design will be of great help to achieve quicker failover.

  • Best Practice - Flexpod Design

    I am working thru a 5548, UCS, and Netapp design. We are using FC, not FCoE. I have followed the FlexPod deployment standard to a "T" but have a couple of questions. First, as we are following our physical layout, EoR, we are placing a pair (two 5548's) at the end of each row to handle FC within that row (client request). We have various FC devices throughout each row, with UCS in one row, Netapp in another, and so forth. The question I have is in regards to "best practice" with the FlexPod standard. No where have I found an FlexPod design document which shows a cascade/aggregation design using an EoR switch connected to another EoR switch with a target/initiator seperated by two 5548s (NPIV/NPV). Is such a design NOT recommended? Can it be done within the standard? The second question is in regards to actual configuration. In this mode, TARGET ---- 5548(row1)-----5548(row2)---- Initiator, I assume the first 5548 is NPV mode, the second NPIV mode. Correct?
    We have not implemented in this fashion before so I am looking for some standards document/configurations,etc related to this. Your help is greatly appreciated...

    The link between the NPV-NPIV Core is not an ISL.
    The link between the NPV-NPIV Core is  F-port type. NPV Switch does not run Fibre Channel services, therefore has NO Fibre Channel Domain ID. 
    NP - Node Proxy port type is introduced on the NPV Switch since it sends requests to the NPIV Core for processing and then relays any applicable information to the downstream hosts.
    As far as FLEXPOD this Doc talks about 5548 in NPIV with UCS in NPV mode.
    http://www.cisco.com/en/US/solutions/collateral/ns340/ns517/ns224/ns944/whitepaper__c07-727095.html
    This might not a full match but it touches the features you are discussing.
    I hope this helps.
    Regards,
    Carlos

  • Best practices or design framework for designing processes in OSB(11g)

    Hi all,
    We have been working in oracle 10g, now in the new project we are going to use Soa suite 11g.For 10g we designed our services very similar to AIA framework. But in 11g since OSB is introduced we are not able to exactly fit the AIA framework here because OSB has a structure different than ESB.
    Can anybody suggest best practices or some design framework for designing processes in OSB or 11g SOA Suite ?

    http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10223/04_osb.htm
    http://www.oracle.com/technology/products/integration/service-bus/index.html
    Regards,
    Anuj

  • Best practice for designing a directory tree

    Hello all,
    I wanted to know what you all think about what is the best way to design a directory tree. Again it seems to me that experience makes the man perfect and I wanted to know what you all think about how to design directory tree model.
    Here is my view; I believe that keeping at least Users/ Employee information flat make more sense to me. I know it’s a good idea that one should consider an organizational hierarchy when designing a tree. But there seems to be some problem too. If employee moves from one department to another within the same organization then directory administrator has to change the location/department of the user. However, if all users are under the same namespace i.e. ou=Users, administrator does not have to change or move users location in the directory to another location.
    Also, while designing a directory there could be several hierarchy, one is organizational hierarchy another could be organizing user info based on job roles i.e. CEO->VPs-Managers->Consultant.... and so on so. So which one should consider. So by considering ou=Users namespace, we are avoiding risk on favoring one type of hierarchy.
    The trade-off in using ou=Users a flat namespace is that browsing of the directory looks less interesting.
    Anyway, this is my view, I would like to know your views too and hope this thread will help other in building their own directory Tree.
    Thanks
    Syed Suhail Ahmad

    Honestly it really depends on what you need your system to do and how you want to handle administration. I have read the argument about keeping things simple with using ou=USERS and seems like the best situation for administration purposes. Currently my client is wanting all identity management to be handled in OID so I am in the process of doing our hierarchy also. I still have to explore the abilities of OID to see how I can set things up.
    There are a few good books and websites that are good for referencing ldap. One book I use is LDAP Programming, Management, and Integration by Donley. For websites, just search on google or check out www.ldapguru.com or www.openldap.org(possibly).
    Hope this helps a little. I honestly can speak on the best way since I haven't implemented my own yet nor do I think one way will always be best for every situation.

  • Best practice for designing a print enviroment​?

    Greetings,
    If there is a better location for this, please let me know.
    Goal:
    Redesign and redeploy my print enviroment with best practices in mind.
    Overview: VMWare enviroment running 2008 R2,  with ~200 printers. I have a majority of HP printers ranging from 10 years old to brand new. Laserjets, MFPs, OfficeJets, etc.. etc.. in addition to Konica, Xerox, and Savin copiers. Many of our printer models aren't support in 2008, let alone x64.
    Our future goals include eprint services, as well as a desire to manage print quality, and consumition levels through something like Web Jetadmin.
    Presently we have a 2003 x86 server running our very old printers and until 6 months ago the rest on a single 2008r2 x64 server. We ended up not giving it the attention of detail it needed and the drivers became very cluttered, this lead to a single UPD PCL6 update that ended up corrupting several drivers across the UPD PCL 5 and 6 spectrum. At that time we brought up a second 2008r2 server and began to migrate those affected. In some instances we were forced to manually delete the drivers off of the clients system32->Spool->Driver and reinstall.
    I haven't had much luck finding good best practice information and figured I'd ask. Some documents I came across suggested that I should isolate a Universal driver to a single server, such as 3 servers for PCL5, PCL6, and PS. Then there is the need to deal with my various copiers.
    I appreciate your advice, thank you!
    This question was solved.
    View Solution.

    This forum is focused on consumer level products.  For your question you may have better results in the HP Enterprise forum here.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • What are the best practices in design patterns?

    What design patterns are likely popular?

    If you go to your local bookstore or online book store you will find at least 20 books that describe this.
    Some how I doubt you are going to get 20 books worth of an answer.

  • Azure table design best practice

    What's the best practice for designing tables in Azure Tables to optimize query performance?

    Hi Raj,
    When we design the azure table, we need to consider the scalability of the azure table.
    and selecting the PartitionKey is very more important to scalability.
    Basically, we have two options which have their advantages and disadvantages:
    One Option: having a single partition by having the same value for PartitionKey for all entities to
    Second Option: having a unique value for PartitionKey for every entity
    More information about how to get the most out of windows azure tables ,please refer to the link below:
    http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx
    There is  also a detailed article which explain how to design a scalable partitioning strategy for Windows Azure Storage,please refer to the link below:
    http://msdn.microsoft.com/en-us/library/hh508997.aspx
    Best Regards,
    Kevin Shen

  • Best practice for retail store cycle count

    Hi experts
    Would you have any experience/best practice in designing for cycle count process for your clients?
    By cycle count, I mean for frequent counting (daily) for specific item category / exceptional count request.
    My client want to implement a cycle count process to minimize the effort for full stock take which happen around 3 times per year.
    They are using SAP as the core system to keep track of inventory, and using external store system, so some considerations would be on, for example:
    - whether the count variance or counted quantity shall be interfaced back to SAP
    - whether SAP should be the source to initiate a stock count process or POS initiate
    It would be very nice if you can share some best practice as in the process flow, system information flow, etc.
    Best regards
    Dominic

    Hello
    Both can be done but as you say SAP is the core system at least for tracking inventories, better create and integrate inventories is SAP aswell.
    The main advice I would give is to avoid specific tables for inventory integration because standard tables and specific won't be updated well sometimes and support would be needed, stick on standard transactions.
    If the inventory is centralised in SAP, you can for example count them with PDA, send to SAP connectors your counting which will be integrated from a xml file transformed in a Idoc for SAP.
    One parameter is important to consider as the freeze for inventory. You have to decide if you take into account any stock movement that could occur after your inventory creation or not. If you do, the variance after the counting will depend on the initial stock value and also the movement.
    If you don't, the variance will only take into account your initial stock value withotu considering the stock movement.
    Hope it helps you,
    Génia.

  • Best practice for a site with a lot of images?

    I am working on a site that will have over a hundred images
    and I wanted to see what is the best practice for designing a site
    like this. Should a go with xml(please give examples or
    explanation), a text file or just loadMovie("image1project1.jpg",
    "bottomsec") with named external images that will stay the same.
    Any help is appreciated on staying up to date with this kind of
    site.
    Thanks,
    Randy

    ok I am new please be nice - I think I want to set it up like
    this
    <project1>
    <section>Architecture</section>
    <name>New Building for CREATiVENESS</name>
    <comment>The major challenge to designing this new
    tower was the site constraints  a small 3 acre urban corner site.
    It is located adjacent to a community center to facilitate extended
    use in the evenings and weekends for the entire community.
    </comment>
    <thumb>thumbs/project1.jpg</thumb>
    <img1>images/project1img1.jpg</img1>
    <img2>images/project1img2.jpg</img2>
    <img3>images/project1img3.jpg</img3>
    <img4>images/project1img4.jpg</img4>
    </project1>
    <project2>
    <section>Interiors</section>
    <name>New Building for Me</name>
    <comment>The major challenge to designing this new
    tower was the site constraints  a small 3 acre urban corner site.
    It is located adjacent to a community center to facilitate extended
    use in the evenings and weekends for the entire community.
    </comment>
    <thumb>thumbs/project2.jpg</thumb>
    <img1>images/project2img1.jpg</img1>
    <img2>images/project2img2.jpg</img2>
    <img3>images/project2img3.jpg</img3>
    <img4>images/project2img4.jpg</img4>
    </project2>
    <project3>
    <section>Architecture</section>
    <name>New Building for You</name>
    <comment>The major challenge to designing this new
    tower was the site constraints  a small 3 acre urban corner site.
    It is located adjacent to a community center to facilitate extended
    use in the evenings and weekends for the entire community.
    </comment>
    <thumb>thumbs/project3.jpg</thumb>
    <img1>images/project3img1.jpg</img1>
    <img2>images/project3img2.jpg</img2>
    <img3>images/project3img3.jpg</img3>
    <img4>images/project3img4.jpg</img4>
    </project3>
    <project4>
    <section>Interiors</section>
    <name>New Building for that guy</name>
    <comment>The major challenge to designing this new
    tower was the site constraints  a small 3 acre urban corner site.
    It is located adjacent to a community center to facilitate extended
    use in the evenings and weekends for the entire community.
    </comment>
    <thumb>thumbs/project4.jpg</thumb>
    <img1>images/project4img1.jpg</img1>
    <img2>images/project4img2.jpg</img2>
    <img3>images/project4img3.jpg</img3>
    <img4>images/project4img4.jpg</img4>
    </project4>
    but I am not sure of the way to create the way to run through
    it to find if it is in a section to put it in the menu and then to
    call the images and text once they are in a project area. I dont
    know if the
    this.firstChild.nextSibling.childNodes[0].childNodes[2]
    is the best way to call things in the file. Any help is
    appreciated. Please let me know what are the best practices and
    easiest way to work with a large xml file.
    Thanks,
    Randy

  • Mapping creation best practice

    What is the best practice while designing OWB mappings.
    Is it best to have less number of complex mappings or more number of simple mappings particularly when accessing remote DB to
    extract the data.
    A simple mapping may be having lesser number of source tables and the complex mapping may be one
    which will have more source tables and more expresssions.

    If you're an experienced PL/SQL (or other language) developer then you should adopt similar practices when designing OWB mappings i.e. think reusability, modules, efficiency etc. Generally, a single SQL statement is often more efficient than a PL/SQL procedure therefore in a similar manner a single mapping (that results in a single INSERT or MERGE statement) will be more efficient than several mappings inserting to temp tables etc. However, it's often a balance between ease of understanding, performance and complexity.
    Pluggable mappings are a very useful tool to split complex mappings up, these can be 'wrapped' and tested individually, similar to a unit test before testing the parent mapping. These components can then also be used in multiple mappings. I'd only recommend these from 10.2.0.3 onwards though as previous to that I had a lot of issues with synchronisation etc.
    I tend to have one mapping per target and where possible avoid using a mapping to insert to multiple targets (easier to debug).
    From my experience with OWB 10, the code generated is good and reasonably optimised, the main exception that I've come across is when a dimension has multiple levels, OWB will generate a MERGE for each level which can kill performance.
    Cheers
    Si

Maybe you are looking for

  • Unable to initialize video deck, (can not capture from camera)

    Hello All, I am using a quad core G5 and am trying to capture some footage into Final Cut Pro version 5.0. I have two Panasonic DVX 100B mini DV cameras. I normally capture with a JVC BR-DV3000 mini DV deck but it is currently not working. So I'm try

  • Digital Signatures and APEX

    Has anyone had any success implimenting digital signatures (PKI) within APEX? Here is a brief synapsis of what we are looking to accomplish and realize that third-party hardware/software might be necessary. We require users to login using LDAP creden

  • Reg : Material warehouse management view 1 & 2

    Hello All, Using a Z-programI am extending the warehouse managemnt view for a single Plant, the view gets created successfully. But some how an Inactive version of Warehouse management view gets created for other plant also. How we can prevent the cr

  • Recording midi music as a WAV f

    For years I've been using a Soundblaster card and the software I got with it (Midi Orchestrator). Making WAV files, and putting them onto a CD was a simple matter. I recently bought a new computer with Windows XP and on-board sound. I was delighted t

  • FX Plug-Ins Doubled

    a minor quibble ... FCP 6.0.1, relatively new install on a clean system. (ie no previous versions of FC or FCS installed except FCP 6.0) i have "all effects" on in "effect availability". i notice in the effects menues that many are doubled. seems to