Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


laztrezort

Member Since 20 May 2009
Offline Last Active Oct 25 2014 12:15 AM

#4926709 Dungeon Generation Problems

Posted by laztrezort on 30 March 2012 - 09:21 AM

Probably the simplest I can think of that produces good results (depending on your needs, that is) is using a binary space partition tree, like what is described here: http://roguebasin.roguelikedevelopment.org/index.php/Basic_BSP_Dungeon_generation. It guarantees connectivity, and also allows a simple way to designate separate areas of the map for containing, for example, entrances and exits. You can also look through the other articles on that site for other ideas.

However, I must say that having experimented with all of this before, getting truly random dungeons while maintaining good results (variety, consideration of other gameplay elements, etc.) can get very complicated very quickly.


#4926538 A good framework for rapid development

Posted by laztrezort on 29 March 2012 - 08:48 PM

If you're interested in 3D*, you can also check out Unity3D, which comes with a very powerful toolchain and decent portability out of the box.

* of course it can also be used for 2D apps, as any other 3D engine these days


#4925246 Neural Network Genome Help Please :'(

Posted by laztrezort on 25 March 2012 - 08:45 PM

Artificial life simulators often use two mechanisms called "crossover" and "mutation" when combining genomes, which are simplifications of the biological processess similarly named.

Crossover is simply splitting the genome (or gene, or chromosome) of each parent at a random position, and combining them together to form a new one. An example of a simple crossover:

Parent 1: ABAB|BBAA
Parent 2: AAAB|BBBA
where the "|" is a randomly determined position, could produce 2 children:

child 1: ABABBBBA
child 2: AAABBBAA

Mutation, which usually has only a small chance of occuring, is just a single random change (for example, flipping an A to a B somehwere in the genome).

The point of crossover is to keep successful genes in the population, while mutation would supposedly create entirely new genes.

I'm no expert on NN, but I would guess one of the challenges would be how to implement the crossover function properly. This would probably depend on whether your goal is training (in which case this is probably a bad method for that) or alife simulation. Assuming the latter, I would personally start here: http://en.wikipedia....able_simulators and see how other NN based simulators are doing it. Framsticks in particular, IIRC, has pretty thorough documentation.


#4923476 Beginner Looking for Examples

Posted by laztrezort on 19 March 2012 - 06:43 PM

Does anyone know where I can download an open source 2D platformer game written in C#.

Yep, here: http://msdn.microsof...udio.31%29.aspx

Also, any advice or links about simple game programming is welcome.


Look at all the other links on the above page.

Or if I'm starting off with something too big let me know.


Probably, even a simple platformer is pretty complex. However, you can poke around the above linked source, and if you feel overwhelmed just concentrate on something simpler, such as one aspect of a game.


#4912338 is learning c++ as first and only language a bad way to go?

Posted by laztrezort on 12 February 2012 - 02:55 PM

Without any experience in programming prior to the above mentioned, is it a terrible idea for me to start right in learning C++? I've seen arguments made for instead to learn C#/Python and I understand (or think I do) that it has reason to do with those already running in their own frameworks or environments or something.


Usually, you will hear people describe C# (and Python, even Java) as more "modern" languages in comparison to C or C++. Basically this means more intuitive syntax and more fleshed out standard libraries (helper functions). Also, C#, Python and Java are examples of "managed" languages, which means that you don't generally have to worry about memory management (which can get complicated and easily introduce bugs).

2. I have a fear that learning one language will be hard enough and am afraid that learning a more basic one will dishearten me as I'd be afraid of the extra time needed to transfer my knowledge from one to the other.


The general advice is that there are certain skills that apply to programming in general, and is language agnostic. So learning any programming language is valuable. Learning multiple languages broadens those skills even more. Once you have gained some experience in programming, moving to a new language is simply a matter of learning the syntax and standard libraries - this gets even easier the more languages you have under your belt.

So, pick a language/environment you are comfortable with. If it is giving you too much frastration, switch. You will not loose anything at this point by not sticking to one and only one language. The more "basic" languages you've mentioned here are fully functional languages, and professional software has and is being made with them, yes even games. The technical details of language choice are quite specific (and argued over even by experts, arguments that threads like these often create), and will not concern you for some time.

Also, even though I have started the learncpp tutorial, I have yet to grab an IDE. I know I need a free one for now because even though I want to be dedicated to this project.. well I don't see myself buying an IDE just yet. Are there choices for free C++ IDEs out there? Any input on which ones are good or which ones should be avoided, much thanks.


I would advise against buying an IDE. If using Windows, the Visual Express IDEs (free) are plenty good. There are certain features that you can pay for, but they are not going to matter to you at this point (if ever). Not sure what choices there are on other OS's.


#4878679 360 red ring of death :(

Posted by laztrezort on 30 October 2011 - 02:33 PM

It was my (possibly flawed) understanding that the "towel trick" is used to purposely overheat the components in order to re-set the weak soldering. In any case, it seems a little dangerous and/or extreme.

Here is some information on the problem, and possibly some other fixes: Linky


#4878123 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 10:28 PM

Also

I try and try for hours, but rarely figure my own answer out without help from someone on here, so I'll take all the help I can get!


Don't get discouraged if problems sometimes seem insurmountable. Some might be (no matter how experienced!), but most just take a lot of blunt force, stubborn perseverance. I've gotten lost for weeks on seemingly little details of this or that. An important skill for any programmer, I believe, is a keen ability to research - of course, research will get much easier as you learn specifics of what to search or ask for.

Good luck!


#4878115 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 10:04 PM

Not to keep begging for more and more, but might you possibly have any thoughts on my damage functions and how I'm handling them with Character member values instead of Weapon member values? Around my third edit of that last big post... If not, you've already been so helpful and generous with your time.


The way I understand it, you have the intuition that WeaponSwingDamage, WeaponThrustDamage, SwingDamageType, and ThrustDamageType could go away from the Character class, and you should be able to get those values directly from the whatever weapon the character has equipped?

There are a couple of ways to go about this, but there are also a couple complications :)

Suppose you do remove those fields from Character and add something like this:

public class Character
{
...
 	int CurrentWeaponIndex;
...
 	public void SwingDamageRoll(Character target)
 	{
      	// instead of keeping a seperate field for the weapon stats, just index directly into the player's weapon list
      	// to get the currently selected weapon.  We store the stats in local variables - this isn't technically necessary, but
      	// it will help keep things readable.
      	int weaponSwingDamage = weaponList[CurrentWeaponIndex].swingDamageType;
      	// do the same for thrustDamage, swingDamageType, etc.
      	...
      	// note that now I'm using the local variable we set above
      	basicDamage = Math.Max(((damageRoll + weaponSwingDamage) - target.Armor), 0);
 	}
 	
}

You will need to rewrite your Equip method accordingly - set the player.CurrentWeaponIndex to the selected weapon #. You will also need to change ThrustDamageRoll method (and whatever other details I may be missing). Hopefully you understand the idea, though?

Also, a little more work, but may result in cleaner code:

It seems to me that damage rolls can be a method of Weapon, instead of Character. If you make these Weapon methods, this would have the added advantage that the Character class never has to even know about damages or damage type. All it needs to do is something like this:

int injury = weaponList[currentWeaponIndex].CalculateThrustDamage(int targetArmor); // or whatever you want to call this method



#4878105 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 09:19 PM


Maybe this will be clearer :)

Where you had this before:

  foreach (Weapon thing in player.weaponList)
        {
                EquipWeapon(player, thing);
                Console.WriteLine("\n{0} equipped!", thing.Name);
        }

You could instead do something like this:

int itemIndex = 0;
Weapon itemToEquip = weaponList[itemIndex];
EquipWeapon(player, itemToEquip);
Console.WriteLine("\n{0} equipped!",itemToEquip.Name);

Which would equip only the first item in the List (since we set itemIndex to 0). Lists and arrays use 0-based indexing, which just means that item indexes start at 0, not at 1 like you might be tempted to think.


HEY!!! Now we're getting somewhere!!! I just had to add player.weaponList because the list is in the Character class and that function is in Main(), but yeah, that worked!!!

Thanks so much!!! :D


Cool! Do you (at least sorta) understand the code above? Also, do you see how you will need to somehow ask the player for which weapon # they want to equip, and use that instead of "itemIndex" above?


#4878101 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 09:07 PM

Maybe this will be clearer :)

Where you had this before:
  foreach (Weapon thing in player.weaponList)
        {
                EquipWeapon(player, thing);
                Console.WriteLine("\n{0} equipped!", thing.Name);
        }

You could instead do something like this:

int itemIndex = 0;
Weapon itemToEquip = weaponList[itemIndex];
EquipWeapon(player, itemToEquip);
Console.WriteLine("\n{0} equipped!",itemToEquip.Name);

Which would equip only the first item in the List (since we set itemIndex to 0). Lists and arrays use 0-based indexing, which just means that item indexes start at 0, not at 1 like you might be tempted to think.


#4878099 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 08:58 PM

Not seeing the whole code, but I suspect you have this line:

Weapon aWeapon = weaponList[0];

Somewhere inside the class definition, not inside an actual method. The compiler thinks you are trying to define a field (a data member of the Character class) called "aWeapon", and then trying to set this field to the first element of the weaponList array (which isn't created until the class is constructed). This is why it is complaining.

Sorry if this isn't making sense, it's late here too :D

And sorry about the array thing, I though perhaps you had used them already!


#4878091 Seeking Beginner Advice for Text-Only Dungeon Game in C# and Python

Posted by laztrezort on 28 October 2011 - 08:14 PM

I can add things to a list, and I'm sure I can remove things as well with a little reading and effort (pulpfists's Goblin Brawl does this), but how in the world do I pick something out of a list to do something with it?

If players have two weapons in player.weaponList, how do I get my equipWeapon() function to work?


Sorry if this is off base (I haven't been following your code very closely up to this point), but getting items out of a List, you can index into just like an array:

List<Weapon> weapons;
// create and use the weapons list
Weapon aWeapon = weapons[0]; // "aWeapon" now references the same instance as the first item in the List (element 0), just like an array
Weapon aWeapon2 = weapons[1]; // this is the second item.  If you go outside the bounds of the List, you will get an error, just like with an array

You will need to know (keep track of somehow) witch index of the list you want to use. In this case, it looks like you can ask the player which weapon they choose (enter a number, for example, and use that as the index into the List).


#4877931 Can someone give me the exact definition/usage of Stack/Heap and Reference Ty...

Posted by laztrezort on 28 October 2011 - 12:08 PM

I think a source of much of the confusion is the stack in C++, where the programmer had much more implicit control. In C# to be honest, I don't really know why they even made the distinguishment. They should have probably ignored the concept completely and made it something only the compiler developers were really aware of. Worst case scenario, for those few edge cases where the developer needed to optimize for stack usage, it could have been exposed as an attribute. Actually, there is already the stackalloc method, so even this wouldn't be need.


Yes, this tripped me at first when moving from C++ (along with a few other memory related details) - the best thing for me (from a practical viewpoint) was to just forget about the hows and whys of memory in .net and trust the framework to take care of it all. I still get a twinge of, er, guilt maybe?, every now and then when tossing around a ton of instanced objects. Old habits, I suppose.

Not to say these things aren't important to know, and some of the wonderful replies here have filled in the rough spots of my understanding.


#4876536 Super efficient tile engine design?

Posted by laztrezort on 24 October 2011 - 06:12 PM

By large number of tiles, I assume you mean size of map dimensions (not the number of different textures)?

I'm not sure why anyone would bother trying to write a "super efficient" tile engine these days. Just make a tile engine, and if you run into memory issues, partition the world into "chunks" and stream the chunks from disk as needed. A modern computer can handle very large amounts of memory very quickly, so I think the more difficult task would be the actual generation of these large maps.

In general, efficiency is probably the last thing you should be worrying about at this stage. Follow Nick's tutorial (or any of the other many tile engine tutorials available) and get something working first.


#4873050 Using XNA RenderTargets

Posted by laztrezort on 15 October 2011 - 11:42 PM

Rendertarget usage can get a bit tricky, if you haven't already you should probably read this and this. If you were more specific (e.g. show some code) you may get some more specific help.




PARTNERS