Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 571 572 [573] 574 575 ... 796

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

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8580 on: December 04, 2015, 04:14:44 pm »

Yeah. I get you, but that weakness likely comes as a comprimise from its strengths.

Besides, in Unity, you could write a singleton object that would simplify the references to that resource. That being said, do look up netpbm, that ought to be possible to use for your method.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8581 on: December 04, 2015, 05:19:30 pm »

I like Game Maker. Like any tool, it has strengths and weaknesses. I quite enjoy that you can reference any resource by just typing its name in your code, as opposed to passing references and typing a million getComponent() lines as in Unity. But then, as is my problem now, Game Maker has rather limited file IO capabilities.

Huh. Undertale's written in Game Maker Studio, and its most well known attribute in terms of gameplay is its use of file i/o.

Of course, I know that fairly in-depth and it's not at all a complicated usage (nothing but a few plaintext files being edited), but it should tell you something that people consider it some marvelously complicated thing when, in fact, all the meta save stuff is just a couple plaintext files being edited.

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8582 on: December 04, 2015, 05:22:34 pm »

Yeah. I think the biggest reason people don't expect it is because it uses a "secondary" save location based off of progress in the game. It's not complicated, but it adds tremendous depth to the game.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8583 on: December 04, 2015, 05:44:02 pm »

It's mostly because they don't understand how computers work. Most people seem surprised when they hear that DF lags like crazy or Minecraft actually needs a decently powerful computer to run well.
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8584 on: December 04, 2015, 05:48:26 pm »

My favorite is people saying that it wouldn't work on console. Friggin what? I mean, there's technical difficulties with the whole "game maker games don't work on console" thing, but even technically
Spoiler (click to show/hide)

Nirur Torir

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8585 on: December 04, 2015, 05:54:41 pm »

I'm interested in starting a side-project of trying to make a roguelike dungeon generator, mostly as a skill exercise. My biggest programming accomplishment thus far is a Python rot13 converter.

What smaller projects should I work on first, before trying to understand a tutorial or dissect some open-source code?
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8586 on: December 04, 2015, 06:06:59 pm »

My favorite is people saying that it wouldn't work on console. Friggin what? I mean, there's technical difficulties with the whole "game maker games don't work on console" thing, but even technically
Spoiler (click to show/hide)
Spoiler (click to show/hide)
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8587 on: December 04, 2015, 07:57:28 pm »

I like Game Maker. Like any tool, it has strengths and weaknesses. I quite enjoy that you can reference any resource by just typing its name in your code, as opposed to passing references and typing a million getComponent() lines as in Unity. But then, as is my problem now, Game Maker has rather limited file IO capabilities.

If it's a language, and you can read and write bytes to a file, then you can do any file-related thing you need. Either you write it, or find a library someone wrote. Unless there's some ridiculous limitations on basic file IO that I'm not aware of. C++ doesn't even have any of the "serialization" stuff from Unity. You just don't need it, and nobody complains that C++ is hobbled with file IO. write your own save and load functions.
« Last Edit: December 04, 2015, 07:59:00 pm by Reelya »
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8588 on: December 04, 2015, 08:45:51 pm »

I like Game Maker. Like any tool, it has strengths and weaknesses. I quite enjoy that you can reference any resource by just typing its name in your code, as opposed to passing references and typing a million getComponent() lines as in Unity. But then, as is my problem now, Game Maker has rather limited file IO capabilities.

If it's a language, and you can read and write bytes to a file, then you can do any file-related thing you need. Either you write it, or find a library someone wrote. Unless there's some ridiculous limitations on basic file IO that I'm not aware of. C++ doesn't even have any of the "serialization" stuff from Unity. You just don't need it, and nobody complains that C++ is hobbled with file IO. write your own save and load functions.

I'm not saying it's impossible to write to a file. I'm saying it lacks a specific feature that Unity has and would appreciate in this situation, where there is a function available to say "Here is my object, doesn't matter what it is, just write it to a file", and a similar function that says "Here is a file that contains an instance of a class, read it and recreate that instance inside this variable."

Of course I can write my own save/load code in GML. I could probably program a supercomputer in GML if I wanted. There is a point at which a tool makes a job easier, faster, and less prone to cockups. I.e., being able to serialize objects just by pointing at a location on disk and saying "There, put my object there so that I can have it later," as opposed to rolling my own functions that probably won't be any better or faster or more space-efficient.
« Last Edit: December 04, 2015, 08:47:23 pm by itisnotlogical »
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8589 on: December 04, 2015, 10:58:12 pm »

i just moved a for loop to tail recursion (for some statistical sampling I wanted to try out) and forgot to actually remove the for loop

also note: when doing tail recursion and decrementing a variable per call to make it halt in javascript, you have to do prefix --, not postfix; I think I can understand why that behavior is, but I still somehow have the urge to ask

EDIT: oh javascript doesn't do proper tail calls... i was only doing those for the timeout anyway, which I just removed to let million-sample trials happen, so whatever
« Last Edit: December 04, 2015, 11:04:39 pm by Putnam »
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8590 on: December 04, 2015, 11:37:40 pm »

well, prefix vs postfix affects what value is returned. Prefix does the inc/dec before the value is returned, postfix does it after.

int x = 1;
int a = x++; // x == 2, and a == 1
int a = ++x // x == 2, and a == 2

if you do postfix then your copied value will lag by 1.

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8591 on: December 05, 2015, 01:04:02 pm »

--snip

I could probably program a supercomputer in GML if I wanted.

You'd find that you need more than one thread. I haven't looked into it deeply, but it appears that all gamemaker programs are limited to one thread.

Eh. So are python programs, no big deal.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8592 on: December 05, 2015, 01:22:55 pm »

Yeah, it's no big deal, because you could just make multiple GM instances and have them talk to each other. One per CPU core.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8593 on: December 05, 2015, 06:09:55 pm »

Sometimes I wonder if I even have the foggiest idea of what I'm doing.
Code: [Select]
if world.tiles[i].province not in world.provinces[world.tiles[(x, y)].province].adjacent:
    world.provinces[world.tiles[(x, y)].province].adjacent.append(world.tiles[i].province)
The world is broken into provinces which are in turn made up by a random-ish collection of tiles. Normally I'd store the tile objects inside the province objects, but someone said I ought to store them separately and now my code is full of nonsense like this.
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.

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8594 on: December 05, 2015, 06:15:38 pm »

Is there any reason you can't have both?
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.
Pages: 1 ... 571 572 [573] 574 575 ... 796