Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


dworm

Member Since 05 Jan 2014
Offline Last Active Private

#5237422 Entity Component System architecture for a 4X game

Posted by dworm on 28 June 2015 - 11:48 PM

i dont get why that solution doesnt appeal you

 

in a normal 4x there arent really many entities so you are free to add whatever wasted component you like, its not gonna make the game heavy and on the other end its gonna simplify things a lot

 

so unless you have a good reason not to do it, just do it...




#5204586 isnt XNA dead?

Posted by dworm on 15 January 2015 - 04:49 PM

I've heard that Microsoft won't update XNA and that it only supports DirectX 9.

Is that true? if so why people are still using it? I wouldn't bother to use something that will stay old forever.

Am i missing something?

 

yeah you are missing the part where  a starting indie team will hardly need to make a call of duty level of 3d game

 

also even esperienced team might prefer to keep workign on something they know well and is easy and fast to develop...




#5204583 Save/Load in C# XNA

Posted by dworm on 15 January 2015 - 04:38 PM

like you i had a lot of problems serializing in xna for many reason but then i truly studied intermediateserializer and well i cant even explain how much it is PERFECT

 

dont ever think of doing anything different from it is my suggestion

 

intermediateserializer solves all of xmlserializer problems very important to games like circular references its super much readable (yeah even xmlserializer is but you have to make it be.. intermediateserializer is just ready to be read as is) it handles super well every kind of collections, null references and usual stuff common in games




#5204312 Who wants to make a game?

Posted by dworm on 14 January 2015 - 03:26 PM

No offense but in a "team" everyone should briing something to the table, if youi are only wanting to learn that is basically what a school should do

 

if at least you would be good at drawing or making music that woudl be another story though




#5203715 C# Code Snippet Review

Posted by dworm on 12 January 2015 - 12:08 PM

i think you dont have much idea how fast is a pc :D

try to do it a 10k times and see...

 

also as efficiency List contains already methods to split themselves...

 

search for List.CopyTo and List.AddRange (RemoveRange too)

tbh i never tried to measure how much faster they are but i guess its better to just use them for your job




#5201935 Basic Game questions from (learning C# by Programming Games) book

Posted by dworm on 05 January 2015 - 07:35 AM

1) "content" is just a string, while Content property of game is a much more complex thing with many fields, one of which is a string pointing at the place in your hard drive where the  content actually is

 

2) we created above with:

GraphicsDeviceManager graphics;

later on we assign graphics to the actual instance of the object

 

3)parementers are like "information", "data" we pass to the method or like in this case the constructor, which will use such things for their purpose

A property instead is usually a way to access a field of the actual object

a better example, lets assume there is a class Human

with the classic fields like height, haircolor etc etc

a typical constructor could be like Human joe =new Human(BasketPlayer);

here the constructor of the human class would assign each field a specific value for the kind of human we are gonna create, our parameter doesnt go directly into the object joe, but hepl create it

while doing:

joe.Height =2.15;

we would just access the field of height and change just that




#5201150 First Game Guidance

Posted by dworm on 01 January 2015 - 11:48 AM

i suggest following a book or tutorials, i think xna is super easy i mean basically you need to know 2 3 more things to play all your game on screen, rest is just optional/advanced

 

if i may i suggest james silva book "building XNA games" i read when i already was making things on xna and offered much more on many aspect of building a game, also many stuff that are needed even in advanced enviroment, like an editor, a quite complex 2d animation etc it was relly powerful, even more if you plan on a 2d game like a platform or something




#5160437 a fitting framework (C#) for a 2D turnedbased RPG ?

Posted by dworm on 14 June 2014 - 12:17 AM

Nice!

 

Well XNA is an idea for me aswell...but am using VS 2012 Xpress and already read that things might don't work out with XNA anymore...

Is there a workaround to still use it there?

yes i never tried it but other ppl did:

 

https://msxna.codeplex.com/releases




#5155089 Crafting system, making economy that matters to player, discussion.

Posted by dworm on 21 May 2014 - 10:37 AM

play a bit of space ranger, the best "real world rpg" with economy ever created

 

second about efficiency... do you really need to SHOW all that happens in every single city?

because if not... you dont really need much efficiency, you just calculate what to do here and there, even every few seconds, nothing huge for processor...

 

and even if you want all the world to funcion real time you dont really need to do EVERYTHING at once

the efficiency is easy:

you split the assignment of actions  on each cycle (or even few cycles) for each city

this way even if you have 200 cities you only check their job once per cycle

you could even split the check between each citizen... since you dont need the merchant to work while the smith work, while the baker work, you can make them work one by one, or make working simple enough

 

anyway i dont think its that much work at all for a modern processor, in the end its pretty much  a few checks like:

baker has floor?

someone wants more bread?

baker is already working?

for stuff like prices you can adjourn them once in a while, at the end of the day, or week or similar




#5153834 Required to replenish resources/nature in 2d.

Posted by dworm on 15 May 2014 - 03:10 PM

 

This system could be done but the process consumption would be high.

really?

unless your map contains like 1 million trees i dont really think it can be that much consuming...




#5153810 naming my game

Posted by dworm on 15 May 2014 - 12:08 PM

"ehy, who s there?"




#5125910 pathfinding behaviour

Posted by dworm on 23 January 2014 - 11:11 AM

yes there surely is something wrong, here is the code

 

 

 
 public void Pathfind(int startX, int startY, int targetX, int targetY)
        {




            Point start = new Point (startX,startY);
            Point target = new Point (targetX,targetY);


            if (start.X == -1 || start.Y == -1)
            {
                return;
            }




            int actualX = start.X;
            int actualY = start.Y;
            squareMap[actualX, actualY].D = 0;
            squareMap[actualX, actualY].F = Math.Abs(actualX - target.X) + Math.Abs(actualY - target.Y);


            openListNumber = 1;
            Openlist[1] = new Point(actualX, actualY);
            bool found = false;
            int step = 0;
            while (!found)
            {


                int D;
                step++;
                D = squareMap[actualX, actualY].D;
                int S;


                foreach (Point dir in ValidMoves(actualX, actualY)) // find lowest  F score
                {
                    int k = D + 1 + Math.Abs(dir.X - target.X) + Math.Abs(dir.Y - target.Y);
                    S = squareMap[dir.X, dir.Y].F;
                    if (S > k)
                    {
                        squareMap[dir.X, dir.Y].F = k;
                        squareMap[dir.X, dir.Y].D = D + 1;
                        squareMap[dir.X, dir.Y].DirX = actualX - dir.X;
                        squareMap[dir.X, dir.Y].DirY = actualY - dir.Y;




                        if (S == 5000)
                        {
                            addToOpenList(dir.X, dir.Y);
                        }
                        else
                        {
                            correctOpenList(dir.X, dir.Y);
                        }
                    }


                }
                squareMap[actualX, actualY].Checked = true;


                if (target.X == actualX && target.Y == actualY)
                {
                    found = true;
                }


                //pick lowest open list
                actualX = Openlist[1].X;
                actualY = Openlist[1].Y;


                RemoveFromList();
                if (openListNumber < 0) { found = true; }


            }


            //backtrack path         
            int pointX = target.X;
            int pointY = target.Y;
            int dirX = 1;
            int dirY = 1;
            if (pointX == -1 && pointY == -1)
            {
                return;
            }


            while (pointX != start.X || pointY != start.Y)
            {
                dirX = squareMap[pointX, pointY].DirX;
                dirY = squareMap[pointX, pointY].DirY;
                pointX += dirX;
                pointY += dirY;
                squareMap[pointX, pointY].IsPath = true;
            }
            squareMap[pointX, pointY].IsPath = false;
        }

this to add to open list:

void addToOpenList(int x, int y)
        {
            openListNumber++;
            Openlist[openListNumber] = new Point(x, y);
            int nTemp = openListNumber;
            int nTemp2 = nTemp;
            int F = squareMap[x, y].F;
            Point temp;
            while (nTemp2 > 1)
            {
                nTemp2 = nTemp / 2;
                if (squareMap[Openlist[nTemp].X, Openlist[nTemp].Y].F > F)
                {
                    temp = Openlist[nTemp2];
                    Openlist[nTemp2] = Openlist[nTemp];
                    Openlist[nTemp] = temp;
                }
                nTemp = nTemp2;
            }


        }

this to remove

 void RemoveFromList()
        {
            Openlist[1] = Openlist[openListNumber];
            openListNumber--;
            int nTemp = 1;
            int nTemp2 = 1;
            bool jump = true;
            Point temp;
            while (jump)
            {
                nTemp2 = nTemp;
                if (nTemp2 * 2 < openListNumber)
                {
                    if (squareMap[Openlist[nTemp2].X, Openlist[nTemp2].Y].F > squareMap[Openlist[nTemp2 * 2].X, Openlist[nTemp2 * 2].Y].F)
                    {
                        nTemp = nTemp2 * 2;
                    }
                    if (squareMap[Openlist[nTemp].X, Openlist[nTemp].Y].F > squareMap[Openlist[nTemp2 * 2 + 1].X, Openlist[nTemp2 * 2 + 1].Y].F)
                    {
                        nTemp = nTemp2 * 2 + 1;
                    }
                }
                else if (nTemp2 * 2 <= openListNumber)
                {
                    if (squareMap[Openlist[nTemp2].X, Openlist[nTemp2].Y].F > squareMap[Openlist[nTemp2 * 2].X, Openlist[nTemp2 * 2].Y].F)
                    {
                        nTemp = nTemp2 * 2;
                    }
                }

                if (nTemp != nTemp2)
                {
                    temp = Openlist[nTemp2];
                    Openlist[nTemp2] = Openlist[nTemp];
                    Openlist[nTemp] = temp;
                }
                else
                {
                    jump = false;
                }
            }

this to correct when a tile is found better than the previous value

      void correctOpenList(int x, int y)
        {
            int nTemp = 1;
            while (Openlist[nTemp].X != x || Openlist[nTemp].Y != y)
            {
                nTemp += 1;
            }
            int nTemp2 = nTemp;
            int F = squareMap[x, y].F;
            Point temp;
            while (nTemp2 > 1)
            {
                nTemp2 = nTemp / 2;
                if (squareMap[Openlist[nTemp].X, Openlist[nTemp].Y].F > F)
                {
                    temp = Openlist[nTemp2];
                    Openlist[nTemp2] = Openlist[nTemp];
                    Openlist[nTemp] = temp;
                }
                nTemp = nTemp2;
            }

        }



#5125657 pathfinding behaviour

Posted by dworm on 22 January 2014 - 09:34 AM

Wanted to asked if this is normal or I did some mistake:

 

http://imgur.com/RJONEkq

 

http://imgur.com/eoDsyiC

 

ofc pink is path, black is obstacle, yellow is the open tiles evaluated

 

It seems there are too many yellow or at least I did expect them to be less, dunno really




PARTNERS