Jump to content

  • Log In with Google      Sign In   
  • Create Account

Theis_Bane

Member Since 29 Feb 2012
Offline Last Active Mar 13 2016 10:05 AM

Topics I've Started

Pathfinding and Databases

18 January 2016 - 08:16 PM

I'm working my way through Programming Game AI by Example, and have come upon the section on graphs and pathfinding.  Now, my game has a very simple grid layout for each room: a simple 3 x 3.  I'm looking at this graph node and edge chapter and thinking, 'Cool, this should solve my pathfinding problems fairly well!'  However, as I use a database as the source of all my game info storage, and my MUD has a huge number of rooms, storing all those nodes and edges and such in a database seems like such a HUGE amount of information, and I've come to wonder if this is the proper way to go.  Any thoughts on my room layout and a good, efficient way to store and search the room for adequate paths?


State Machine in ECS

27 December 2015 - 06:37 PM

Allllllllright, so.  I'm programming a server/client MUD in C# using a form of the Entity/Component design paradigm.  I've made a substantial amount of headway, even reaching the point where I can move about the world and interact with simple objects and other players with no problems or glitches.  However, I ran into some issues when I started learning about and implementing a state machine for AI purposes.  From what I can tell, the State Machine design in Programming Game AI by Example will not work for an Entity/Component system, at least, one like mine.  My basic design is as follows:

 

All of my components are managed separately by their own respective managers.  Each manager is instantiated in a Region object representing a specific area of the game.  I do this so that I don't have to load large amounts of data into memory in order for players to interact with the world.  Only regions with players are active.  Others update the database and are disposed of.  All components are in a dictionary keyed to the ID of the Entity that owns it.

 

My entities are basics classes containing their ID, their Region ID, a List of ComponentMap objects that describe the type of component and ID for each component it contains.  (this hasn't really been of any use yet, but I'm loathe to remove it until I'm sure).

 

Most of my 'system' code lies in my Game class.  This class handles the different regions, and has methods for logging in and out, character creation, updating client information, and so on.  I basically just pass around the currently focused Region and Entity, and do work. 

 

I'm having a hard time wrapping my head around state machines though, at least in this context.  Since my entities don't hold any of their own data, a State Machine can't really do much.  I've run into a wall.  Any advice on State Machines in an ECS?


Map Zooming and Detail

20 May 2014 - 04:22 PM

I had an odd thought the other day. Say you had a continent level map, detailing the shape of the land, terrain features, and interesting locations. Now, say you wanted to be able to zoom in and out of that map to get a greater level of detail, but you didn't want to go in and draw out multiple levels of detail for every inch of the landscape.

Would it be possible to generate say, beach shape, on the fly as you zoom in by using a seeded randomly generated number to calculate terrain variations based on the main image and previous zoom levels? If so, how would one go about calculating this? Am I even making sense?

WPF and maps

26 March 2014 - 02:50 PM

Don't know if this the right forum but here goes. I'm planning a setting building program/game where you can either draw out a map and add zones like towns and forests, or scan a hand drawn map and define the different zones. For now, the main purpose will be information storage (like town info and maps, forest encounter tables and general info). I picture it almost like a DM's setting assistant.

However, I've done little to no graphics programming, so I'm unsure how to proceed. Do I use tiles? I don't even know. In the future, I'd like to be able to add animation to my natural features ( like trees blowing in the wind). I operate mostly I WPF. Any advice on where to begin?

WPF DataBinding

27 September 2013 - 11:53 PM

OH THE GODS!!!! This problem has me ready to EAT THIS COMPUTER.

 

I have a character sheet designed in WPF that I am attempting to bind to a global Character object that holds all the information for the player's avatar.  Each TextBlock that displays info looks like this:

<TextBlock x:Name="tbkStrTotal" Grid.Row="1" Grid.Column="4" HorizontalAlignment="Right"
                       Foreground="White" Background="Black" Text="{Binding Strength}"

Because I wanted changes to my Character object to update my CharacterSheet window, I went through and implemented INotifyPropertyChanged.

Relevant code:

public class CharacterInfoModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string m_Strength = "20";

        public string Strength
        {
            get
            {
                return m_Strength;
            }
            set
            {
                m_Strength = value;
                OnPropertyChanged("Strength");
            }
        }

        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }

Next, after initializing all of my windows, I hooked my CharacterInfoModel object to my CharacterSheet window's DataContext property.

public CharacterScreen()
        {
            InitializeComponent();
            this.DataContext = GameInfo.Character;
            
        }

The whole thing works great, until I try to change the value of Strength through code.  It won't update.  My PropertyChanged handler is always null, even though I thought it was supposed to get wired up automatically when I bound my CharacterInfoModel object to my CharacterSheet window's DataContext property.  Well, I think that's how it works.  I can't actually find anyone on the Google that can explain how it gets wired up, only that it NEEDS to be wired up.  So, halp.  Thanks in advance.


PARTNERS