Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Vapourware Trying to learn programming from ~0, realistic goals naturally help needed.

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
thanks.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
:troll:

Good languages teach you discipline, scope of variables, knowing index bounds etc
such languages are for example C, CPP, Java, C#
don't start with VBA / Visual Basic etc!!
completely ruins your ability to write programs without creating a total mess

some vba programmers write
Code:
Option Explicit Off
On Error Resume Next
over every program .. always works .. somehow, and entirely stupid later
"my program changes variables, and I turned off errors"
"but I don't understand what is in the variables"
if variables dont even need to have a type, and the scope is global, how can you know whats going on??
 
Self-Ejected

Ulminati

Kamelåså!
Patron
Joined
Jun 18, 2010
Messages
20,317
Location
DiNMRK
It gets more fun when you work with php. What's in $foo? An integer? A string? A boolean value? An array of arrays of alternating strings and doubles? God only knows!
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
Ok then people i think after goal2 i will go back to learn C# syntax and stuff then some practice like goal2 then C+. It should give me an "idea" if i can put it that way about languages.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
I can help you with C#. It can be a really useful language and has no real disadvantages.
C++ is even more useful, but will also be a much harder road, for a long time.
 

baturinsky

Arcane
Joined
Apr 21, 2013
Messages
5,526
Location
Russia
I could switch to C++ after Quick Basic without much problem, so no point being overly paranoid about it.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
What i have in mind with OO is more like fill for my procedural generation idea.

I can create basic template for let's say animal (think enemy) and this animal will have:

mass
attack
color

Then i can write simple loop script operating on list of random 1to10 numbers and crate 10 different animals based of function in that loop.
Then class will return me important things like if animal is big or small or heavy which then i can calculate in combat math.

Though i think for now i should practice with lists and dictionaries instead.
I currently think about what to put in GOAL2. I think i should focus on above and do simply practical game systems for my insertfuturegame project. Like magazine, backpack, basic monster and combat math. weapon generator based on materials and stuff like that. As goal3 i should connect dots and put it as a simple game. For now in python naturally.

Also i learned something about I/O but this was mainly basic .txt import export. Are thare any libaries for python that handle stuff like XML ? Naturally i could use notepad stuff but then i would need to write script that would find what is what in pure text. Importing via cells like a(1-20) would be much easier and faster as datastructure.

edit:
on a sidenote i wonder how I/O works in Dwarf Fortress as game raws are simple TXT files.

Yes. that is possible, but an example of the trivial "classes are for structuring data"-case.

Code:
List<Animal> animals
for(i=0 to n)
{
Animal animal = RandomizeAnimal()
animals.Add(animal)
}

function animal RandomizeAnimal()
{
switch random=Random()
case 1:
animal = new Dog()
case 2:
animal = new Cat()
//etc..
animal.Randomize()
return animal
}

it would also bring polymorphism into the picture, and casts (cast is something that you will need to use a lot no matter what ..) so you can understand what all that is about.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
So i've read C# is one of two main unity languages and python has only plugin instead of being fully supported.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
My advice would be to leave Unity aside until you understand a programming language.
Otherwise you would be messing up a rather complex API (Unity) with the core language and that could be frustrating.
Remember what we said before that we want to keep your code very small and easy to understand, and a powerful framework like Unity is at odds with that.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
Yeah my plan isn't to completely go into Unity and learn stuff using Unity.
I also want to stay into small code --> ton of practical stuff mentality.

What i am thinking about Unity is side thing that should not keep me occupied more than hour a day. Mainly to grasp simple things like how to generate map and simple 3d object that will go somewhere where i click. Though that stuff is naturally just a thought for now as i am still green as hell.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Sure.
Just keep in mind that you only ever want to use third party stuff for things that you cannot/should not do yourself.
The problem is until you really know what you CAN do, and hook up into something big like Unity, you will end up with a ton of dependencies (which lead to other dependencies ..) and that's not what you want.
Whatever you do, I bet 90% can be done with generics, file IO etc, and Unity is only needed for 3d graphics and 3d entities stuff.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
Yeah definitely i won't be doing anything noticeable on engines from for a loooong time.


I decided that after goal2 i will switch to C#. As i understand C# compiles stuff ? Which means it will be much easier to make .exe files.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Yes, C# makes exes or dlls, piece of cake.
Running them needs a .NET runtime but it is on almost any Windows computer these days.

And don't use WPF it is crap.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
c+ means no dependencies like .net at a cost of being beaten by code like a bitch ?
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
Then how the hell most of games come without ones ? I mean there are ton of games with .net and stuff but most actually don't have any other dep than main instalation.
Integrated into their engine ?
 

JMab

Augur
Joined
Nov 12, 2013
Messages
177
Location
Melbourne, Australia
As BB said above, the .NET Framework comes pre-installed on all modern Windows flavours.

Same with the Visual C++ runtime.

However, to be certain, commercial games will include the installation of their required runtime components with their installer. You probably haven't noticed them being installed when you have installed your games as they normally install in "quiet mode" without prompts, and are usually configured to not install over the top of existing installations of the same version.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
nah i would notice it. It's not like i am tinkering with Pcs since yesterday. Aside from usual Direct X .net seems to be second most used dep. Still .net seems to be like 30% of stuff i usually see in games.

Damn tommorow should be a day when i will have more time for coding.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Learning C# in an XNA thread? We are trying to steer this guy from rabbit holes, not into them.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
managed to finally run py2exe. Damn that was annoying to setup. For some reason python wasn't added to my system path as variable

ok now i need to create that vendor script
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
ok now i have little problem.

Is there any way without using count loop to multiply list.append(x) function without it creating sublist ?
I mean if i will do list.append(x * 20) it will just insert into list xxxxxxxxxxxxxxxxxx (if x is string naturally)

What i intend is that i created scriptt that generates random number of things from my dictionary.
Second script now will check for keys like '9mm bullet' or '10mm bullet' and if on that list there are those keys for each of them it will generate 19 more bullet types.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,804
ok i almost figured it out but :
Code:
for bullet in vendor_goods_list:
    if bullet == '9mm bullet' or bullet == '5.56 bullet':
        count = 0
        while count < 19:
            vendor_goods_list.append(bullet)
            count += 1
            print bullet

this creates infinite loop for some reason. but vendor_goods_list is finite !


edit:

Ok i got this @.@ I forgot to make list copy and i operated on actual list !.
Beautiful case when i finally see with my own eyes that i should first make copy of list instead of operating on original.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom