Tag Archives: Python

Yesterday I fucked up… a little

I’ve been playing with a Python script to re-arrange the films in my movie directory; it moves everything of a selected file type from directory and sub-directory to a selected directory.

Useful eh?

Thought I might use it to group all of my photos too.

Last night I ran it on a drives root directory for all *.txt files.

Let me rephrase that, I moved every text file from all directories to my root directory.

This was only a backup drive, but I expect there might be a few programs that fail, as config files may have moved… on the upside, I know a good place to look for them is the folder in the root directory named ‘txt files’ 🙂

retro need

Tired of current gen titles, plus mates have borrowed the games I fancied playing, I setup my XBOX 360 and PS3 again.

Such an awesome collection of titles, I can’t wait to introduce to the boy.

Found it mad that there are a few of them that I’ve bought the PS4 remakes of 🙂

This then took me down a retro root and I installed a Linux MAME emulator to go back to my favourite platform title Wardner.

Not everyone sees the beauty of the game, but I have fond memories of playing a Japanese version of it at lunch, and after school, being able to get through the full game on 10p.

The rest of my game time as been committed to Elite Dangerous.
A colleague is new to the game, so I logged on with the intention of passing on some credits to help him on his way.

Within the first hour I made 3 insurance claims on expensive ships, simply because I’d forgotten the controls.

Mitigation kicked in and I bought a Sidewinder to bring back the muscle memory and remember what the fuck I was doing.

2.4 is in alpha testing, to be released soon, named ‘The Return’ – Thargoids are coming!
So naturally I’ve been hooked again in preparation.

I’m running a Clipper with 2 class 6 First Class cabins, with a single jump I’m making as much as 2.5MM credits, inching up the rank with each departure of passengers.

I’m tempted to follow the Road to Riches, for something different to do, I always enjoyed flying the Asp… also fancy climbing back in a Diamondback and getting my combat skillz back up to speed; think that could be useful with the Thargoids return.

Great that these are not mutually exclusive as my bank balance is looking healthy enough to kit out a few ships to a high grade.

I’ve been tempted to go down the Python route, although not sure why I’m reluctant… maybe it’s the idea that I’ll then have to grind engineers to better equip the ship?

I’ve also joined the Mobius group, which means I can play on-line without the distraction and stife of players who would want to blow away, or steal, my hard earned credits.

Status

I got thinking after my last post of why I chose Unity, and could Python be an option as a language to build games?

I have much more need for Python on a daily basis… although I’m currently limited to ver 2.7 at work, I do use it for the current Feed2Twitter Raspberry Pi setup.

So for the past few days I’ve been digging around searching for material and tutorials to play with.

One impressive example comes from a post on the Ubuntu Forums from over 7 years ago:

I was experimenting with Python over the last week, and I made this example app for various 3D stuff. I titled it PolarisGP, and I was making it with lax intentions of making a flight racing game. However, in case I lose interest, I’d like to put it out there for posterity.

It includes some examples of pretty cool techniques:

Basic linear algebra

Quaternion rotation

Axis/magnitude angular velocity

Display lists

.obj file loading

Efficiently extracting “up,left,forward” vectors from a matrix

Using an inverse matrix (in this case, from a quaternion) to create a camera system

Thanks CurvedInfinity wherever you are now 🙂

I’ve uploaded the code to GitHub as it’s easier to share… & I wanted to get more familiar with the hosting code: https://github.com/gamer-geek/PolarisGP

# Make sure things were found
if len(r.json()['data']['children']) > 0:
# Fetch each thing's ID
for thing in xrange(0, len(r.json()['data']['children'])):
# and save it to the list
things_list.append(r.json()['data']['children'][thing]['data']['name'])
karma += r.json()['data']['children'][thing]['data']['ups']
karma -= r.json()['data']['children'][thing]['data']['downs']