Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Should I Learn C# Right Now? Where to Start?


  • Please log in to reply
11 replies to this topic
Xei
  • Members
  • 115 posts
  • Last active: Feb 11 2018 05:22 PM
  • Joined: 20 Jan 2012
My ultimate goal, currently, is to learn C#. Would anyone be willing to share their recommendations as far as tutorials go? Do you have favorite forums to visit and get help(by the way, I REALLY love this forum. The help and response times here are incredible)? Where do you think I should start? My very first attempt at scripting was with RGSS("Ruby Game Scripting System," based on Ruby). I didn't get very far at all with that. Below is an example of a RGSS script I wrote. My second scripting language was and still is AHK.

Published on July 7, 2011
#So far this script will return the damage value of any normal attack or specified spell utilizing formulas which contain variables(which are ever-changing stats of both the Hero and Enemies). This script serves to support, at minimum, the damage calculation, X/Y positioning, and keyboard input portions of this game.
 
#RGSS is the scripting language used. RGSS is based on Ruby.
 
#Hash marks(#) represent comments for the text following on that line; these lines serve only as reminders. They are #notes.
 
 
 
 
class Enemy_Attributes
  attr_accessor :id_A                       # Actor ID
 
 
  attr_accessor :id_E                       # Enemy ID
  attr_accessor :x_E                        # Enemy map x-coordinate (logical)
  attr_accessor :y_E                        # Enemy map y-coordinate (logical)
  attr_accessor :real_x_E                   # Enemy map x-coordinate (real * 128)
  attr_accessor :real_y_E                   # Enemy map y-coordinate (real * 128)
  attr_accessor :tile_id_E                  # Enemy tile ID (invalid if 0)
  attr_accessor :character_name_E           # Enemy character file name
  attr_accessor :character_hue_E            # Enemy character hue
  attr_accessor :opacity_E                  # Enemy opacity level
  attr_accessor :blend_type_E               # Enemy blending method
  attr_accessor :direction_E                # Enemy direction
  attr_accessor :pattern_E                  # Enemy pattern
  attr_accessor :move_route_forcing_E       # Enemy forced move route flag
  attr_accessor :through_E                  # Enemy through
 
 
  def initialize (id_E)
    #~~Gather's Enemy Stats~~#
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_id" to the Attribute Reciever's value.
    #--------------------------------------------------------------------------
    @enemy_id = id_E
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_name" to Enemy Name
    #--------------------------------------------------------------------------
    @enemy_name = $data_enemies[@enemy_id].name
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_maxhp" to Enemy Basic Maximum HP
    #--------------------------------------------------------------------------
    @enemy_base_maxhp = $data_enemies[@enemy_id].maxhp
    #-----------------------/-8+---------------------------------------------------
    # * Set Variable "@enemy_base_maxsp" to Enemy Basic Maximum SP
    #--------------------------------------------------------------------------
    @enemy_base_maxsp = $data_enemies[@enemy_id].maxsp
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_str" to Enemy Basic Strength
    #--------------------------------------------------------------------------
    @enemy_base_str = $data_enemies[@enemy_id].str
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_dex" to Enemy Basic Dexterity
    #--------------------------------------------------------------------------
    @enemy_base_dex = $data_enemies[@enemy_id].dex
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_agi" to Enemy Basic Agility
    #--------------------------------------------------------------------------
    @enemy_base_agi = $data_enemies[@enemy_id].agi
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_int" to Enemy Basic Intelligence
    #--------------------------------------------------------------------------
    @enemy_base_int = $data_enemies[@enemy_id].int
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_atk" to Enemy Basic Attack Power
    #--------------------------------------------------------------------------
    @enemy_base_atk = $data_enemies[@enemy_id].atk
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_pdef" to Enemy Basic Physical Defense
    #--------------------------------------------------------------------------
    @enemy_base_pdef = $data_enemies[@enemy_id].pdef
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_mdef" to Enemy Basic Magic Defense
    #--------------------------------------------------------------------------
    @enemy_base_mdef = $data_enemies[@enemy_id].mdef
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_base_eva" to Enemy Basic Evasion
    #--------------------------------------------------------------------------
    @enemy_base_eva = $data_enemies[@enemy_id].eva
    #Jump to "def actor_stats" method.
    actor_stats
  end
 
  def actor_stats
    @active_battler = 1
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_id" to Enemy ID
    #--------------------------------------------------------------------------
    @active_battler_id = $game_actors[@active_battler].id
    #--------------------------------------------------------------------------
    # * Set Variable "@enemy_name" to Enemy Name
    #--------------------------------------------------------------------------
    @active_battler_name = $game_actors[@active_battler].name
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_maxhp" to Enemy Basic Maximum HP
    #--------------------------------------------------------------------------
    @active_battler_maxhp = $game_actors[@active_battler].maxhp
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_maxsp" to Enemy Basic Maximum SP
    #--------------------------------------------------------------------------
    @active_battler_maxsp = $game_actors[@active_battler].maxsp 
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_str" to Enemy Basic Strength
    #--------------------------------------------------------------------------
    @active_battler_str = $game_actors[@active_battler].str
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_dex" to Enemy Basic Dexterity
    #--------------------------------------------------------------------------
    @active_battler_dex = $game_actors[@active_battler].dex    
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_agi" to Enemy Basic Agility
    #--------------------------------------------------------------------------
    @active_battler_agi = $game_actors[@active_battler].agi
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_int" to Enemy Basic Intelligence
    #--------------------------------------------------------------------------
    @active_battler_int = $game_actors[@active_battler].int
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_atk" to Enemy Basic Attack Power
    #--------------------------------------------------------------------------
    @active_battler_atk = $game_actors[@active_battler].atk
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_def" to Enemy Basic Physical Defense
    #--------------------------------------------------------------------------
    @active_battler_pdef = $game_actors[@active_battler].pdef
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_mdef" to Enemy Basic Magic Defense
    #--------------------------------------------------------------------------
    @active_battler_mdef = $game_actors[@active_battler].mdef
    #--------------------------------------------------------------------------
    # * Set Variable "@active_battler_eva" to Enemy Basic Evasion
    #--------------------------------------------------------------------------
    @active_battler_eva = $game_actors[@active_battler].eva
    input_trigger_check
  end
 
    #--------------------------------------------------------------------------
    # * Look for Input Trigger
    #--------------------------------------------------------------------------  
  def input_trigger_check
    if Input.trigger?(Keys::A)
      @active_skill_id = 76
      skill_calculate
    elsif Input.trigger?(Keys::S)
      @active_skill_id = 53
      skill_calculate
      elsif Input.trigger?(Keys::D)
      @active_skill_id = 46
      skill_calculate
      elsif Input.trigger?(Keys::SPACE)
      @active_skill_id = 1
      crit_chance
 
    end
  end
 
    #--------------------------------------------------------------------------
    # * Crit Chance
    #--------------------------------------------------------------------------   
  def crit_chance
    @normal_attacks_crit_chance = 4 * @active_battler_dex / @enemy_base_agi 
    @skill_crit_chance = 0
    @item_crit_chance = 0 
 
    random_1_100 = rand(1-100)
 
    if random_1_100
      @crit = true
      normal_attack_calculate
    end
    
 
 
  end
 
    #--------------------------------------------------------------------------
    # * Normal Attacks
    #--------------------------------------------------------------------------  
  def normal_attack_calculate
    #FORCE FORMULA - for Normal Attacks
    @normal_attack_force = @active_battler_atk - (@enemy_base_pdef / 2)
 
    #MULTIPLIER FORMULA - for Normal Attacks
    @normal_attack_multiplier = 20 + @active_battler_str
 
    #VARIANCE PERCENTAGE TO INTEGER VALUE - for Normal Attacks
    @normal_attack_variance = 15.0
    normal_attack_damage_range
 
  end
 
 
    #--------------------------------------------------------------------------
    # * Skills
    #--------------------------------------------------------------------------  
  def skill_calculate
    #Gather attributes about the skill being used; name, power, atk-f, etc.
    @skill_name = $data_skills[@active_skill_id].name
    @skill_force = $data_skills[@active_skill_id].power
    @skill_atk_f = $data_skills[@active_skill_id].atk_f
    @skill_pdef_f = $data_skills[@active_skill_id].pdef_f
    @skill_mdef_f = $data_skills[@active_skill_id].mdef_f
    @skill_str_f = $data_skills[@active_skill_id].str_f
    @skill_dex_f = $data_skills[@active_skill_id].dex_f
    @skill_agi_f = $data_skills[@active_skill_id].agi_f
    @skill_int_f = $data_skills[@active_skill_id].int_f
    @skill_variance = $data_skills[@active_skill_id].variance
 
    #MULTIPLIER FORMULA - for Skills
      @skill_multiplier = 20 + #Calculates the multiplier value of the skill
      (@active_battler_str * @skill_str_f / 100) +
      (@active_battler_dex * @skill_dex_f / 100) +
      (@active_battler_agi * @skill_agi_f / 100) +
      (@active_battler_int * @skill_int_f / 100) 
 
    #VARIANCE PERCENTAGE VALUE- for Skills
      @skill_variance = @skill_variance
 
      #Damage Dealing Skill Used
    if @skill_force > 0
      print "Used " + @skill_name
    #FORCE FORMULA - for Damaging Skills
      @skill_power = @skill_force +
      (@active_battler_atk * @skill_atk_f / 100) -
      (@enemy_base_pdef * @skill_pdef_f / 200) -
      (@enemy_base_mdef * @skill_mdef_f / 200)
      skills_damage_range #Jump to Skill Damage Calculation method
 
      #Healing Skill Used
    elsif @skill_force
    #FORCE FORMULA - for Healing Skills
      @skill_power = @skill_force
      print "Used " + @skill_name
      skills_healing_range #Jump to Skill Healing Calculation method
 
      #State Skill Used
    elsif @skill_force == 0 
     print "Used " + @skill_name
 
     #No value provided for Skill Used
    elsif
      @skill_force == nil
      print "No value provided for the skill"
    end
  end
 
    #--------------------------------------------------------------------------
    # * Normal Attacks Damage Range Determination
    #--------------------------------------------------------------------------
 
 
 
  def normal_attack_damage_range
    #FINDING THE INTEGER VALUE BASED ON THE VARIANCE PERCENTAGE - for Normal Attacks
    @normal_attack_variance_intiger =
    @normal_attack_force *
    @normal_attack_multiplier / 20 * (@normal_attack_variance / 100)
 
    #Determine the minimum and maximum damage range.
    @min_damage =
      @normal_attack_force *
      @normal_attack_multiplier / 20 - @normal_attack_variance_intiger.round
    @max_damage =
      @normal_attack_force *
      @normal_attack_multiplier / 20 + @normal_attack_variance_intiger.round
 
    normal_attack_final_damage
  end
 
    #--------------------------------------------------------------------------
    # * Normal Attacks Final Damage
    #-------------------------------------------------------------------------- 
  #Determine the final damage utilizing the minimum & maximum range.
  def normal_attack_final_damage
    @normal_attack_final_damage = rand(@[email protected]_damage)[email protected]_damage*2/2
    print @normal_attack_final_damage.to_s
  end
 
 
 
    #--------------------------------------------------------------------------
    # * Skills Damage Range Determination
    #--------------------------------------------------------------------------  
  def skills_damage_range
 
 
  end
 
    #--------------------------------------------------------------------------
    # * Skills Healing Range Determination
    #--------------------------------------------------------------------------  
  def skills_healing_range
#Incomplete
    print "healing_range"
  end
 
  def say
#    For Debugging purposes
#    print @enemy_name, "'s Basic Max HP = ", @enemy_base_maxhp
#    print @enemy_name, "'s Basic Max SP = ", @enemy_base_maxsp
#    print @enemy_name, "'s Basic STR = ", @enemy_base_str
#    print @enemy_name, "'s Basic DEX = ", @enemy_base_dex
#    print @enemy_name, "'s Basic AGI = ", @enemy_base_agi
#    print @enemy_name, "'s Basic INT = ", @enemy_base_int
#    print @enemy_name, "'s Basic PDEF = ", @enemy_base_pdef
#    print @enemy_name, "'s Basic MDEF = ", @enemy_base_mdef
#    print @enemy_name, "'s Basic EVA = ", @enemy_base_eva
  end
 
 
end

The above is code that I published on July 7, 2011. The script has long since been abandoned, but hopefully you are able to judge my skill level as it was on that date, and be able to recommend to me the next step I should take as a programmer. Should I jump into C#, or do you strongly urge me to learn something more simple, first?

Among many other reasons, the one major reason I want to learn C# is to create games using XNA.

Pillow
  • Guests
  • Last active:
  • Joined: --
C# is fun and easy to learn (comparatively) and is perfectly suited for making video games.
However, think outside of the box for a minute here as this sounds like a business decision. I realize that you are targeting XNA, but how many angry birds can you kill with one stone:

What target platforms are you developing games for?
Android phones:
Solution #1: (free) Eclipse Development Environment, Android SDK, and Java JDK.
Solution #2: Adobe Flash CS5 or CS6. (AS3)
Solution #3: Microsoft Visual Studio 2010 (or better)

XBox360:
Solution #1: Microsoft Visual Studio 2010 (or better) with XNA.
This supports a wide variety of languages that can be compiled into dynamic link libraries.
Solution #2: Commercial game engine + join/hire team of professionals.

A great place to start is load up your favorite game and watch the splash screens at the beginning to determine which game engines they used. Some examples are Havok and Unreal.

There are a lot of hats in the gaming industry: designers, programmers, writers, make-up, storyboard, physics, testing, marketing, accounting, actors, audio engineers, musicians, artist, background artist, photographers, etc. etc. etc. It is really tough to go it alone.

One way to get involved is to focus on a career that fills a specific need(s) in the gaming industry.
Watch the credits at the end of the video game to see a role that you might be able to fill. Check the careers section of the various game companies and gaming engine companies to find out what careers are in the highest demand.

Another option would be to join/create a group of like-minded, online buddies and work on an open source project.

As far as programming goes start with something simple like moving stuff around on the screen and move up to collision detection. Keep your eyes peeled for related "Black Art" keywords and jargon. Here are a few fun keywords to get you started: tutorial, Cartesian Coordinate System, Side-Scrolling Platform Game, Isometric Game, AS3 games, open source gaming engines, double buffering, multiplayer online, dynamic link libraries, keyboard handler, mmorpg, and xna tutorial.

Learning several languages is a good habit, but at times can get a bit confusing. As far as games go Visual Studio 2010 (if target is XNA) and Flash CS5 are both good candidates.

References:

http://www.havok.com/
http://www.unrealengine.com/
http://www.adobe.com...ng_engines.html
http://www.ogre3d.org/
http://msdn.microsof...y/bb203893.aspx

Another important question to ask yourself is: What type of game do you want to develop?

zenedee
  • Members
  • 1 posts
  • Last active: Nov 02 2012 07:55 AM
  • Joined: 02 Nov 2012
C# is a better choice because it is very easy to learn and also its syntaxes are very similar to Java and C++. So after your C# study you can easily learn Java and C# . Check this website , http://csharp.net-informations.com , it provide step by step help for almost all subjects in C#.

zene.

S0und
  • Members
  • 100 posts
  • Last active: Apr 08 2015 10:07 AM
  • Joined: 16 Feb 2007

hijacking this topic!

 

 

C# + AHK mix:

comboxbox%i%.Items.AddRange(items);

 

I have 10 Comboxbox, is there any equivalent sollution in C#?

String[] items = { "A", "B", "C" };

for (int i = 0; i < 9; i++) {
    comboxbox%i%.Items.AddRange(items);
}


IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007

I have 10 Comboxbox, is there any equivalent sollution in C#?

 
C# is a strong typed language, thus dynamic features are only supported by occasion. (There are movements supporting scripting language features such as the dynamic variable, where expressions are evaluated at runtime.)

Generally, you use a list/array, where all your comboxes are stored in.
 

var myBoxes = new List<ComboBox>();

// store the controls

myBoxes.Add(box1);

myBoxes.Add(box2);

myBoxes.Add(box3);


// now your code

var items = { "A", "B", "C" };

foreach(var box  in myBoxes)
{
  box.Items.AddRange(items);
}

@Topic: IMHO: C# is the most elegant high level programming language and outperforms Java and Co by far. Visual Studio even makes the decision more clear, the developer performance is that much better than for example using Eclipse/Java.

The biggest problem of C# is the proprietary background, bound to MS. Mono does not really change that fact.

If I use Java, then because I want to support Mac and Windows at the same time. But it is not easy to reach a great UI which can compare to the great OSX Application interfaces. Most of the time, one ends up writing a dedicated App for OSX.

A good, free ebook for c# and OOP is C# von Eric Gunnerson, sadly I can only find the German version.



S0und
  • Members
  • 100 posts
  • Last active: Apr 08 2015 10:07 AM
  • Joined: 16 Feb 2007

thanks IsNull!  During my last couple of AHK projects i really picked up the dynamic aspect of the language a lot. Just to make everything lot more cleaner and simpler. 



tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
C# is great but consider this moble application development will(argueably it already has) take over as the primary venue. JAVA has security concerns that arent going to go away anytime soon. but even tho this is true i highly recommend looking at HTML5 and googles "native client". Native client is the biggest (my oppinion) emerging technology threat to JAVA's footprint. a browser delivered full compiled application with robust security. and its free. The best part is you can go ahead and learn the sexy c# and then use the porting tools to turn it into a native client app that will run in any OS that supports Chrome more here http://code.google.com/p/nativeclient/
Never lose.
WIN or LEARN.

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
oops sorry native client currently only supports c and c++
Never lose.
WIN or LEARN.

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
@tank: You can use C# to develop native mobile applications.

We have currently a relativly big project, where we have had a Client (Windows Desktop) Server (WCF) Architecture, and now have to support mobile clients with native apps.

MonoTouch and Mono for Android are great and allow to reuse big parts of the business layer written in C#. cool.png

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007

@isNull

don't get me wrong c# is uber sexy. My point was more that if your already a c or C++ developer you dont have to learn a whole new lang to move into a distributed application. No download means authenticating to your server on every use which gives more control on licensing and revocation. and for some idiotic reason i thought i had read Native client already ports C# even tho having just said that out loud it seems kind of silly to do so. 

C# is also far more secure than JAVA which has exploited Microsoft Apple and Facebook security only recently. So Not only is C# super sexy it is also less exploitable


Never lose.
WIN or LEARN.

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007

C# is also far more secure than JAVA which has exploited Microsoft Apple and Facebook security only recently.

Yeah that was a quite "funny" header in the news: Microsoft got hacked through their Mac Computers running a Java Applet. Now go figure.
 
I think languages will become more simple over time, and at some point there wont be any difference in programming language and scripting language. (As, for example, performance does no longer matter because it makes no longer a significant difference.)
Well, even Bill Gates said in a recent interview, that he is surprised that the programming languages didn't become more simple.
 
I think LINQ in C# was a good start to integrate more human like patterns in a language. But there should also be an equivalent system allowing such statements as proactive actions; and indeed, JavaFX introduces something in this direction.

 

 

Some pseudo Code to visualize this is probably the simplest way to show what I mean:

var numbers = [1,2,3,4]
numbers = insert [7,8] in [1,2,3,4]
if(numbers contains 7){ ... }

Which basically means the introduction of a bunch of new keywords, which simplify expression code; that is, the new statements are completely valid expressions and therefore just integrate in the current way of coding. 

This is not a revolutionary approach, but at least will make code more readable and faster to type.

That would be something I dream of to be integrated in AHK. 



Xx7
  • Members
  • 674 posts
  • Last active: Mar 24 2015 10:48 PM
  • Joined: 19 Apr 2011

Just started learning C# a couple weeks ago... and my MIND is BLOWN!!!!! by how simple it is to create applications and professional looking GUIs.  I'm impressed by the number of features and how easy it is to write code (eg. autofill feature).  For example, if you wanted to put a youtube video in a GUI.. you just import the flash object and insert it.. takes about 5 seconds.  Also, there are a tonne of widgets you can put into your GUIs as well as a host of libraries that have customized features.

 

 

Try thenewboston tutorials on youtube.  He's got about 200 that start at a very low level, but work their way up quite quickly.  The guy is very good.

 

 

 

Go to 6:40 and check out how impressive this interface is..

 

 

 

Here's a customized ListView control that can be added.  I'd say it may be a little bit better than AHKs... wink.png

 

http://www.youtube.com/watch?v=hsY5OLRwNYw