Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Brian Sandberg

Member Since 10 Oct 2003
Offline Last Active Dec 14 2014 09:36 AM

#5196782 Programming Laptops (-numerics pad)

Posted by Brian Sandberg on 07 December 2014 - 08:01 AM

I picked up one of these recently, to be able to work at a client's location.  (Damn, Dell seem to have raised the price quite a bit since then!)  Great performance, cpu/3d wise, and doesn't overheat; worst it does is make a slight noise when the fan starts.  Lovely machine; if it could swivel the display to turn into a hybrid tablet, I'd want it to have my babies.

http://www.dell.com/us/p/xps-15-9530/pd

 

I haven't missed the numeric keyboard at all; don't worry about that.

 

Interestingly, even though I hook it up to a larger display at the office, I find myself using the laptop as the primary display anyway.  I'd say one specification you definitely should pay attention to is resolution.  If you get an 15" screen, don't accept anything less than 1920x1080.




#5182877 To Day I had to Resort To a FileBack Up

Posted by Brian Sandberg on 25 September 2014 - 07:33 AM


One more reason to buy server class drives.

 

No.  One more reason to use 3 or more drives in a raid, as well as keeping your work files in version control on a remote machine.

 

Every single-point-of-failure will eventually bite you in the ass.




#5173934 Stuck in C#......

Posted by Brian Sandberg on 15 August 2014 - 11:43 AM

When the user enters something, you get a piece of text back.  What you need to do is to find out if they actually wrote a number, and then determine what number that is, so you can use it to retrieve an element from your list of pokemons. Luckily, the built-in number types have methods for parsing text.  To convert text to an integer, you might use Convert.ToInt32() or Int32.Parse() or Int32.TryParse().

 

You also want to do some sort of error handling; if the user didn't enter a number, or they wrote a larger number than you have pokemons, then you should ask them again until they enter something valid.

 

Here's a simple loop to do that.

Pokemon SelectedPokemon = null;
do {
	Console.WriteLine("Please choose your Pokemon: (1,2,3)");
	Console.WriteLine("1. Blastoise, 2. Blazekin, 3. Meganium");
	string myChoice = Console.ReadLine();

	if (myChoice == "1")
		message = "Blastoise, a water Pokemon, with lots of health. Good Choice!";
	else if (myChoice == "2")
		message = "Blazekin, a fire Pokemon, with lots of Power. Let's do this!";
	else
		message = "Meganium, a plant Pokemon, with lots of health. Best of luck!";

	Console.WriteLine(message);
	Console.ReadLine();

	int SelectedPokemonNo = 0;
	if( !Int32.TryParse( myChoice, out SelectedPokemonNo ) )
	{
		// uh oh, myChoice wasnt a number
		Console.WriteLine( "That's not a pokemon! Try again" );
		continue;
	}
	SelectedPokemonNo--; // make it a 0-based index
	if( SelectedPokemonNo < 0 || SelectedPokemonNo >= myPokemon.Count )
	{
		// uh oh, myChoice out of range
		Console.WriteLine( "That's not a pokemon! Try again" );
		continue;
	}

	SelectedPokemon = myPokemon[SelectedPokemonNo];
	Console.WriteLine( "You selected {0} with {1} health.", SelectedPokemon.Name, SelectedPokemon.Health );

}
while( null == SelectedPokemon );

Something else you might think about is how you have built the pokemon names and descriptions directly into the code that asks to choose between them.  A better design would be to put the descriptions ("a water Pokemon, with lots of health") into another field in the Pokemon class, and have the menu retrieve it from there.

 

I think it would be good for you to read some tutorials on C#; they would have taught you about converting texts to numbers, and using lists, and countless more details.  I just googled up this one; there are 23 pages and it looks decent - if you go through all those those, you'll be much better prepared.  Enjoy smile.png  http://www.csharp-station.com/Tutorial/CSharp/Lesson01




#5172383 Stuck in C#......

Posted by Brian Sandberg on 08 August 2014 - 06:10 PM

In the .NET world, you would use a System.Collections.Generic.List<T> to hold your pokemons.  Maybe this will help you - if not, ask again and try to better describe exactly what it is you would like to do.

using System;
using System.Collections.Generic;
using System.Linq;

namespace Practice_Battle
{
	class Pokemon
	{
		public string Name;
		public int Health;
	}

	class Program
	{
		static List<Pokemon> Pokemons = new List<Pokemon>() {
			new Pokemon {
				Name = "Charizard",
				Health = 200
			},
			new Pokemon {
				Name = "Garchomp",
				Health = 180
			},
			new Pokemon {
				Name = "Metagross",
				Health = 220
			}
		};

		static void Main ( string[] args )
		{
			var rnd = new Random();
			var randomPokemon = Pokemons[rnd.Next( Pokemons.Count )];

			Console.WriteLine( "You were given a {0} with {1} health.", randomPokemon.Name, randomPokemon.Health );
		}
	}
}




#5172185 How would the graphics be if...

Posted by Brian Sandberg on 07 August 2014 - 07:44 PM

As a reference, Diablo 1 had a budget of $750K and Diablo 2 apparently had a budget of $9 mill.

 

Maybe a better rule of thumb is looking at the amount of work involved.  Starting at the low end indie scale, you typically have 2-3 people working anything from half a year to several years.  At the high end of the scale you have hundreds of people working up to 5 years.  Google around, look at the various indie games being released and see what complexity seems to correspond to various development times.  Then do the math, dividing up how many people can live how many months off your $75K, and you'll have something to compare with.

 

Torchlight, a modern low-budget Diablo-esque game, based in part on some opensource engines, was made by 25 people working 11 months.

 

If 3 people huddled together in a cheap apartment and lived off nothing but ramen, they could probably make some sort of RPG for that budget.  A team doing it as a job?  Not so much.

 

This might sound snarky, but it's not meant that way - until you know enough to make these things immediately obvious to you, you will only hurt yourself starting such a project. But hey, if your plan is to save money for a couple of years first, you have a lot of time to learn.  Don't be discouraged, just find out what you're in for.




#5164795 How To Save A Non-Grid-Based Level For A Game

Posted by Brian Sandberg on 04 July 2014 - 03:37 PM

Like Lactose wrote, there are loads of ways of doing it.  It'd probably be best for you to start out using some standard format like XML or JSON, instead of inventing your own text or binary format.  Then you'd have a file like

 

<map>

  <object id="MyObject">

   <type class="MyAwesomeObject" />

    <position x="100.023" y="39.5" z="-882" />

    <rotation z="23" />

  </object>

  ...

</map>

 

or

 

[

  {

     id: "MyObject",

     type: {

        class: "MyAwesomeObject"

     },

     position: {

       x: 100.023,

       y: 29.5,

       z: -882

     },

    rotation: {

      z: 23

    }

  }

  ...

]

 

Your language of choice will most likely an API for easily serializing/deserializing objects to text like this.

 

Depending on the size of your level, you can either keep it in memory as a flat list of objects like this, or you might need a spatial partitioning datastructure, like a simple 2d array or a quadtree, to contain the objects, so you dont have to traverse them all in order to touch the objects in a smaller area.




#5156995 Scripting solution for C# project

Posted by Brian Sandberg on 30 May 2014 - 11:14 AM

You could solve the clumsy-syntax issue by storing your state in a 'dynamic' object instead of your propertybag.  Serializing that should still be simple and quick.




#5153797 How do you know if you are not reinventing the wheel in your language

Posted by Brian Sandberg on 15 May 2014 - 10:34 AM

My wheel has an extra degree of freedom and is more of a ball joint really, and also has fittings for when I later want to attach a jet engine.  Don't judge; it seemed like a good idea at the time :)

 

Seriously though, there can be good reasons for reinventing the wheel.  It can be a learning experience, or you may need some feature that doesn't exist and makes it faster to reimplement from scratch than add to an existing library. If you're writing code as a hobby, then write what interests you. If you're doing a job for money, then other considerations become more important.




#5093984 Your opinion on C# graphical libraries

Posted by Brian Sandberg on 14 September 2013 - 06:15 AM

You can get C# bindings for just about every popular library.

 

For example, have a look at OpenTK for OpenGL bindings; you can certainly learn the basics with that, and since half the industry is running on OpenGL, it is something you can take with you.

 

Most 2D games are still made with a 3D API like OpenGL, but if you want a 2D API for the easier learning-curve, have a look at the bindings for SDL or SFML.




#5030154 Starting with OpenGL ES 2

Posted by Brian Sandberg on 08 February 2013 - 01:13 PM

Yes, you can do your OpenGL programming on Ubuntu.  OpenGL 2 is effectively a superset of OpenGL ES 2, so if you stay within the confines of the ES features, you'll be fine.  Mesa also supports the ES2 profile, so you could have a look at that.  But if you want to write for mobile devices, having access to one will serve you well.

 

I'm sure other people, and Google, will can link any number of tutorials; I remember this book as being helpful http://www.amazon.co.uk/OpenGL-ES-2-0-Programming-Guide/dp/0321502795

 

Do you mean if there's a chance to learn the fundamentals in 6 months?  Yes, definitely!  Especially since you probably already know a lot of the basic concepts and math from XNA.

 

Making an indie game can pay for college roughly the same way buying a lottery ticket can, unfortunately.  It's possible, but luck plays a huge factor.




PARTNERS