Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 596 597 [598] 599 600 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 908322 times)

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8955 on: February 08, 2016, 08:19:28 pm »

In Python, you'd use the timeit module to see how fast small snippets of code run
Is there any advantage to this over time.time()?
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8956 on: February 08, 2016, 08:39:45 pm »

In Python, you'd use the timeit module to see how fast small snippets of code run
Is there any advantage to this over time.time()?

This is what timeit was built for. Manually checking runtime with time.time() isn't the best measure - every run of your code won't be exactly as fast as every other run. timeit can run something a large number of times and give you results from that.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8957 on: February 09, 2016, 02:53:41 am »

Links or it didn't happen?

I know that if you're in C (Or probably C++) one option is to use a few clock() calls to get processor time, and you might be able to do the comparison that way.
Personally I'd use the <chrono> library. I think it might be higher precision.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8958 on: February 10, 2016, 01:17:07 am »

Something interesting for folks to take a look at; EA has now entirely officially opened up their EA STL library for the public: https://github.com/electronicarts/EASTL

In particular, reading the initial comments on the header files which describe the differences between it and the STD STL library. Each modification exists for a reason, often because of some thorn in their side they needed to correct. Such STL replacements are common throughout the game dev industry; and often exist to accommodate ease of porting to consoles lacking proper STL support (as can be the case for unreleased consoles still only partway through development, or things with weird specs like no exception handling).
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8959 on: February 10, 2016, 01:20:17 am »

you know the L in STL stands for "library" right

anyway... actually, that could be very nice, when's the last time EA had a botched multiplatform release?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8960 on: February 10, 2016, 02:02:46 am »

Actually, it makes its money back by only allowing you to use their cloud services for it.
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8961 on: February 10, 2016, 02:09:56 am »

All these free engines coming out of the woodwork and here I am doing OpenGL in Python
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8962 on: February 10, 2016, 02:29:15 am »

Look I'll get there eventually, just need more polygons
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8963 on: February 10, 2016, 08:06:55 am »

Well, to what end? OpenGL by hand isn't a bad thing to do, but don't expect to make, say, a game from that basis. Or at least, never expect to finish.
I'll have you know that all the Ludum Dare entries I coded use only handwritten OpenGL (legacy mode, because need for speed). Honestly it's way easier and more flexible than using an engine or such.
Logged

Nullsrc

  • Bay Watcher
  • A Euclidean Plane Crash
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8964 on: February 10, 2016, 09:49:16 am »

Lots of open-source games are made using OpenGL - it can certainly be done, but at the same time I've heard lots of griping that OpenGL itself is hard to work with for certain things.
Logged

Malus

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8965 on: February 10, 2016, 01:11:52 pm »

Unity is going to be the easiest way to go, probably. But if it's just a 2D game you could use SDL and C++ which handles most of the nitty-gritty stuff for you. You'd still need to write your engine and all that entails, but you wouldn't have to deal with too many different platform nuances like manually loading OpenGL extensions on Windows.
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8966 on: February 10, 2016, 01:14:12 pm »

if it's 2d even phaser js can fit the bill, it's veary easy to build prototypes there
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8967 on: February 10, 2016, 01:16:27 pm »

I would use something like allegro or sdl over Unity for something like that, because for what you want to make, you'll be pretty much just using Unity as a graphics engine, and writing the rest yourself.
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8968 on: February 10, 2016, 01:21:44 pm »

Unity's been promising a pretty neat feature called SmartSprite for a while now. I don't think it's coming anytime soon, mind you, but it looks like it'll be an actual reason to use Unity for side-scroller type games in the future. It makes level generation really easy by letting you draw polygons, then automatically tiling the texture inside and drawing the border around the outsides for you, using a tileset kind of system.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8969 on: February 10, 2016, 04:33:49 pm »

Unity's been promising a pretty neat feature called SmartSprite for a while now. I don't think it's coming anytime soon, mind you, but it looks like it'll be an actual reason to use Unity for side-scroller type games in the future. It makes level generation really easy by letting you draw polygons, then automatically tiling the texture inside and drawing the border around the outsides for you, using a tileset kind of system.
That actually sounds really neat.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.
Pages: 1 ... 596 597 [598] 599 600 ... 796