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,883
#GOAL2 - practice makes you stronger, faster, better....

- make magazine/clip system
- make vendor system
- make simple combat system
- make procedural weapon creation system consisting of (material, type, weight, sharpness and short description that will use earlier variables to describe weapon)


Tis but a short list but it will give me practice i need and it will be at the same time practical thing that will help me later.
Currently i don't have time to code but i will go back to it today
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
Ok any interesting IDE ? I already heard about Eclipse+PyDev also i found nice dark theme LiClipse for it.
Any things i should or should not do ?
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
ok i tried liClipse and i fucking can't for hell run simple program. I set interpreter in preferences but for some reason it ask for module.
I am dumb or what ? Also i set theme to be dark and still is fucking white.

Any other IDE ?
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
It is preconfigured for Python or i need to do stuff like in eclipse ?
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
Then i'll probably stick with eclipse for now and then i will see netbeans. Still i need to figure out what the hell is wrong with my eclipse
 

Raghar

Arcane
Vatnik
Joined
Jul 16, 2009
Messages
22,710
Best IDEs are for assembler, because they were made by fans. When you normally encounter common programmers they don't have any clue how a reasonable IDE should looks like, and looks like they are accustomed to MSVC style. Latest MSVC are not that bad, it just others somehow managed to be worse.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
oh syntax is different that in codeacademy training.

For exampe i need now print ("hello world") instead of just print "hello world"
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
I wish requiem was my first touch with Skyrim. Instead i was raped by shitty vanilla gameplay.
 

Sensuki

Arcane
Joined
Oct 26, 2012
Messages
9,800
Location
New North Korea
Codex 2014 Serpent in the Staglands Shadorwun: Hong Kong A Beautifully Desolate Campaign
Alternatively you can "fix your timestep", which is typically done at 30 or 60 frames per second. This gives the advantage of not needing to scale your update logic. It is also necessary for your physics engine, as they all work better if updated at a consistent time step. Also, by running your game faster than than rate at which your monitor can refresh (typically 60Hz/60 frames per second), you risk seeing tearing on the screen, as the game has started rendering the next frame into the back buffer while the last is being presented to the screen by the monitor. This is avoided by turning on the vsync option in the config.

I find this method is used more often in games with multiplayer. The value can be set by the server in quake3 engine based games, although some things (such as the speed of projectiles) scale with the server fps value, this causes a few bugs particularly in Call of Duty 2 and 4. I think Valve's source games now use either 64 or 128 updates a second or something.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
ok i did first sub goal of my GOAL2

magazine script:

Code:
print("Magazine reload program")

amount_of_bullets = input("Enter number of bullets you have in your pocket: ")
amount_of_bullets = int(amount_of_bullets)
amount_of_bullets_left = 0
magazine_size = 8
bullets_in_magazine = []
count = 1

while count <= amount_of_bullets and count <= magazine_size:
    bullets_in_magazine.append("JHP 10mm bullet")
    count += 1

amount_of_bullets_left = amount_of_bullets - (count - 1)

print("Reloading !")
print("MAG STATUS: ", len(bullets_in_magazine), "/", str(magazine_size))
print("bullets left in your pocket :", amount_of_bullets_left)

You may notice that bullets in magazine are actually each individual string instead of being simple number (which would be waay faster to do). As i mentioned point is that i will want to make every bullet different entity so in future i will be able to have different kind of ammo in combat for weapon.

don't want to write function or classes currently which should tidy up my code

also is there a way to put something from list a to list b without loops ? like a function or something (like insert())
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
also how to compile something ? let's say i want above to be fired up in for example cmd or something.

edit:

i am using PyCharm
 

7h30n

Augur
Joined
Aug 14, 2012
Messages
311
oh syntax is different that in codeacademy training.

For exampe i need now print ("hello world") instead of just print "hello world"

CodeAcademy training was in Python2. You are using Python3 which is different than Python2, in this case you need to type print with parentheses as a regular function.

If you want to use Python3 read the Tutorial section (to improve your foundation and probably learn more than in codeacademy) and always look in the Library Reference for functions that make your tasks easier. https://docs.python.org/3/
Same thing but for Python2 is here: https://docs.python.org/2.7/
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
also what about compiling stuff i mentioned earlier ?

I mean i want for example to do small quick game. How to compile it ? I mean to be .exe that i would be able to run ?
 

7h30n

Augur
Joined
Aug 14, 2012
Messages
311
Wait there are different pythons ? or you mean python 3.0+ ?

There are currently 2 Python versions used. Python 2.x and Python 3.x. Python 3 is obviously newer but there are some minor and major changes compared to Python2. A lot of the libraries and modules are written for Python2 but that is changing rapidly (and every major library is already ported), so I would recommend you learn Python 3.

Regarding compilation. Python is an interpreted language. In order to run your programme you need to run it through interpreter, e.g. on console > python my_python_programme.py
If you really need to make an .exe I suggest you look into Py2Exe and such software.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
i tried Py2Exe but i says that i don't have python 2.5 where i have installed both 2.7 and 3+.

Maybe i should ask differently. How the hell i can put my game into exe or something like that so people would be able to fire it up and play ?
 

7h30n

Augur
Joined
Aug 14, 2012
Messages
311
i tried Py2Exe but i says that i don't have python 2.5 where i have installed both 2.7 and 3+.

Maybe i should ask differently. How the hell i can put my game into exe or something like that so people would be able to fire it up and play ?

In order to that you need a tool like py2exe.
Edit: I'm not familiar with other tools, but searching the web or stack overflow will help you find them.

According to this, the latest version supports Python 3 https://pypi.python.org/pypi/py2exe
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
i tried Py2Exe but i says that i don't have python 2.5 where i have installed both 2.7 and 3+.

Maybe i should ask differently. How the hell i can put my game into exe or something like that so people would be able to fire it up and play ?

In order to that you need a tool like py2exe.
Edit: I'm not familiar with other tools, but searching the web or stack overflow will help you find them.

According to this, the latest version supports Python 3 https://pypi.python.org/pypi/py2exe

Looks like there are some compatibility problems between Py2Exe version and python versions. I downloaded lates which state (any) no deal. Then i downloaded some older which was for 2.7 and it worked though i assume it will only work under 2.7 code.
 

Perkel

Arcane
Joined
Mar 28, 2014
Messages
15,883
Those problems are exactly i don't want to deal with. I assume C+ doesn't have such problems...
 

k-t

Novice
Joined
Oct 29, 2012
Messages
18
also is there a way to put something from list a to list b without loops ? like a function or something (like insert())

There is a method called extend, which allows to append contents of one list to another. So your loop can be rewritten as:
Code:
bullets_to_reload = min(magazine_size, amount_of_bullets)
bullets_in_magazine.extend(["JHP 10mm bullet"] * bullets_to_reload)
 
Self-Ejected

vivec

Self-Ejected
Joined
Oct 20, 2014
Messages
1,149
I just saw this thread as I was logging out. Jerked me right back. I am sorry that I have not read the 8+ pages of the thread. So if someone already contributed the following suggestions, I beg your pardon.

DO NOT start with Python as your first programming language. You will end up crippling your ability to quickly learn other languages. It is *too* intuitive and easy to follow compared to other languages and thus makes it *harder* to cope with others. I read your OP and I will give you a more qualified opinion than ones you find in your initial survey.

Most programming languages are easy to learn ones you learn one of the core languages with a general overview of core programming paradigms. I started with CPP. Once you learn it, you are flexible enough to move around and learn anything else on the go.
 

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