Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411526 Posts in 69377 Topics- by 58432 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 09:01:58 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 221 222 [223] 224 225 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 738991 times)
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #4440 on: January 19, 2014, 08:46:33 PM »

If you have 'thrown' and 'thrown_by_player', both of which transition to 'ground' when they hit something, then just disallow the player catching things in 'thrown_by_player' state.

Another solution is to not let the player catch thrown things unless they are travelling towards him.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #4441 on: January 19, 2014, 09:04:58 PM »

-long rant-
Yo you might like Haxe a lot actually. Let's you target flash, native and several vms, has a c# target too I think. Feels like writing as3 with a bit of Java and c++ in there to me. Most importantly has a maintained flixel port Smiley would be a very easy language to get off the ground and running from, and seems like it's got more staying power due to being able to retarget.

I've been playing with it this weekend Smiley
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #4442 on: January 22, 2014, 03:26:43 AM »

As an actually grumpy aside getting properly xplatform networking in Haxe going has been a pain, mostly for web clients. Flash has semi-good remoting socket support but no clean "raw" socket, js has kludges or extern libs for websocket. I'll need to write a good wrapper for it at some point by the look of it and just live with native sockets under cpp and neko targets in the meantime.

(Considering networking is treated like black magic by 99% of the indies I know this shouldn't dissuade the target of the above post, but aw hell is it frustrating)
Logged

Noogai03
Level 6
*


WHOOPWHOOPWHOOPWHOOP


View Profile WWW
« Reply #4443 on: January 22, 2014, 10:22:43 AM »

-long rant-
Yo you might like Haxe a lot actually. Let's you target flash, native and several vms, has a c# target too I think. Feels like writing as3 with a bit of Java and c++ in there to me. Most importantly has a maintained flixel port Smiley would be a very easy language to get off the ground and running from, and seems like it's got more staying power due to being able to retarget.

I've been playing with it this weekend Smiley

hmm, I haven't looked at Haxe at all...
it looks interesting
Logged

So long and thanks for all the pi
surt
Level 7
**


Meat by-product.


View Profile
« Reply #4444 on: January 24, 2014, 01:19:30 PM »

I spent forever trying to get a GLSL program to work that was whinging about "Different sampler types for same sample texture unit in fragment shader."
It turns out that PyOpenGL's compileProgram function performs a glValidateProgram immediately after linking when the OpenGL state isn't fit at that point to perform validation. Angry
Wrote my own compile program function and the GLSL program works fine.  Crazy
Logged

Real life would be so much better with permadeath.
PJ Gallery - OGA Gallery - CC0 Scraps
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #4445 on: January 25, 2014, 09:42:45 AM »

ugh never try to reinvent timezone implementation EVER, it's not programming it's archeology, astrology, quantum physics and history all at the same time
Logged

ink.inc
Guest
« Reply #4446 on: January 25, 2014, 10:30:08 AM »



Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #4447 on: January 25, 2014, 10:46:07 AM »

Now that's a grumpy old programmer
Logged

R.D.
Level 2
**


Making a game about balls. Yepp.


View Profile WWW
« Reply #4448 on: January 26, 2014, 12:10:38 PM »





Actually this was very informative.
Logged

bateleur
Level 10
*****



View Profile
« Reply #4449 on: January 27, 2014, 09:04:20 AM »

Today I noticed that I had a set static functions in class Foo that took an instance of Foo as the first parameter in each case...

...Gosh, it seems to come up a lot. If only there was some convenient way to handle that case.

Facepalm
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #4450 on: January 27, 2014, 09:53:02 PM »

It's funny how hard you can try to fight OO sometimes, only to end up writing more tangled, but still fundamentally OO code.
Logged

bateleur
Level 10
*****



View Profile
« Reply #4451 on: January 28, 2014, 02:30:09 AM »

It's funny how hard you can try to fight OO sometimes, only to end up writing more tangled, but still fundamentally OO code.

In case anyone's curious, I did eventually track down why this code was written that way. Exactly one of the functions in question was called from a lot of places where the Foo parameter could be null. Coding it as a static function saved wrapping all the calls in "if (myFoo) { ... }".

The other functions were C&P'ed then tweaked based on the first, apparently with insufficient thought given to the process!
Logged

Will Vale
Level 4
****



View Profile WWW
« Reply #4452 on: January 30, 2014, 03:41:57 AM »

Added SDL2 as a new platform for my little engine, which meant writing a tiny GL renderer and fixing a couple of obscure SDL bugs Sad

Used this to get one of these games up and running on my Android phone, which meant dealing with Android.mk and ndk-build, and ant, and adb Sad Sad Shocked

I didn't manage to find out why SDL_GL_GetProcAddress returns NULL for all the core GLES API functions. Especially since it uses dlsym to get them (since EGLGetProcAddress only handles extensions). I did manage to load a few GL functions from EGL rather than GLES, but not all of them, so I think there's probably some weird stuff going on in the import stubs for GLES/EGL on Android? It's not a device problem since it was the same on the emulator, maybe it's an android toolset version thing?

In the end I gave up on the dynamic load and linked against GLES directly...

Oh well, at least I can say I've done it now. Plus I built premake5 and learned how to use it a bit, which was awesome. I need to extend it to generate the Android build crap now that I know roughly what that should look like.

Cheers,

Will
Logged
oahda
Level 10
*****



View Profile
« Reply #4453 on: January 30, 2014, 04:30:33 AM »

Getting something done, no matter how grumpy the process had made me, would throw me straight back into the happy state. Huh?
Logged

Will Vale
Level 4
****



View Profile WWW
« Reply #4454 on: January 30, 2014, 03:34:53 PM »

Ha, the optimism of youth!

I admit to being a bit less grumpy today when I was able to get a proper game (graphics, audio, touch input) running on the 'phone at 60Hz in well under an hour. Still don't like OpenGL much though!

I was quite pleased that my data files (which are essentially memory dumps with a list of fixups and an index) worked first time Smiley Obviously this wouldn't be the case if the platform endianness was different, but that's something which can be fixed when it comes up.

I really need to automate the makefile generation, and write a nice stub library to provide an appropriate main function.

Will
Logged
makerimages
Level 2
**


Makerimages Studios


View Profile WWW
« Reply #4455 on: January 31, 2014, 12:29:31 PM »

Im grumpy because Slick2D's Image class is not serializable by default.
Logged

Makerimages-Its in the pixel
R.D.
Level 2
**


Making a game about balls. Yepp.


View Profile WWW
« Reply #4456 on: February 05, 2014, 06:01:52 AM »

Im grumpy because Slick2D's Image class is not serializable by default.

Why would you want to serialize an image anyway? It's a honest question, because I'm not sure of the use case.
Logged

Blambo
Guest
« Reply #4457 on: February 09, 2014, 07:32:56 PM »

Hey guys, back with another dumb problem!

Code:
for (i=0;i<10;i++){
    for(j=0;j<8;j++){
        tile_color[i,j]++;
    }
}

I'm most definitely being stupid somewhere. This should loop through tile_color and adds one to each element, but GM keeps throwing out an out of bounds error. I initialized the array before and made it 10x8.

Here's where I initialized. grid_width is 10 and grid_height is 8:

Code:
for (grid_x=0;grid_x<grid_width;grid_x+=1) 
    {
    for (grid_y=0;grid_y<grid_height;grid_y+=1)
        {
            if (ds_grid_get(dsGrid_obstacles,grid_x,grid_y) == 0){
                    if(irandom(25) = 1){
                        ds_grid_set(dsGrid_obstacles,grid_x,grid_y,1);
                    }
                    else{
                        tile_color[grid_x,grid_y]=irandom(3) mod 4;
                    }
                    if (ds_grid_get(dsGrid_obstacles,grid_x,grid_y) == 2){
                        spawned = true;
                    }
                    else{
                        spawned = false;
                    }                   
            }
            if (ds_grid_get(dsGrid_obstacles,grid_x,grid_y) == 1){
                instance_create(grid_x*global.grid_res,grid_y*global.grid_res,oBlocker);
            }
        }
    }

I hope that's enough information
Logged
TheLastBanana
Level 9
****



View Profile WWW
« Reply #4458 on: February 09, 2014, 08:26:27 PM »

My GML is a bit rusty, but it seems like you only have a 1 in 25 chance of initializing each element of the array.

Also, I realize = and == are equivalent in this case, but you might save yourself a headache later if you change this:
Code:
if(irandom(25) = 1){
to this:
Code:
if(irandom(25) == 1){
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #4459 on: February 15, 2014, 09:56:13 PM »

Just had that really hilarious moment where you realise unity doesn't have nested prefabs and all the shit you just built is going to be useless or a maintenance time whore. Tired
Logged

Pages: 1 ... 221 222 [223] 224 225 ... 295
Print
Jump to:  

Theme orange-lt created by panic