Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What programming topic would you want the next challenge to be about?  (It might be a good opportunity to focus on a subject you're not familiar with or to reinforce knowledge on one that you already know)

Control Flow
- 2 (2.2%)
Arrays, Strings, Pointers, and References
- 8 (9%)
Functions
- 4 (4.5%)
Basic object-oriented programming
- 30 (33.7%)
A bit more advanced OOP (Composition, Operator overloading, Inheritance, Virtual Functions)
- 18 (20.2%)
Templates
- 8 (9%)
Other (Explain)
- 4 (4.5%)
Working with files?  (Streams)
- 15 (16.9%)

Total Members Voted: 89


Pages: 1 ... 55 56 [57] 58 59 ... 78

Author Topic: Programming Challenges & Resources (#bay12prog) Initiative  (Read 95842 times)

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #840 on: January 28, 2011, 03:48:33 am »

I read really good stuff about Bullet, but that was a while ago.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Supermikhail

  • Bay Watcher
  • The Dwarf Of Steel
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #841 on: January 28, 2011, 04:55:00 am »

Oh, yeah. Continuous collision detection. I almost died of dehydration drooling at it. But it's made for 3d and macro, takes rotation, and all the other stuff into account... So, there's another "stage" to my game, where it could be useful, if I live to code that stage... Oh. No, I mainly need graphics on 3d objects then, not physics. Fortunately, there seems to be quite a few Java 3d game engines these days...


Well, I'm retarded. Should have searched for game engines. Not physics engines. There's a flood of 2d game engines which include collision detection, graphics, and etc. Stubborn me, however, wants to have procedural graphics...

Edit: after a bit of searching I've stumbled on this video. That's what I want my game to look like... Or it would be more correct to say, feel like. I guess I can't do without a third-party library for that.
« Last Edit: January 28, 2011, 06:09:43 am by Supermikhail »
Logged

Blank Expression

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #842 on: January 28, 2011, 11:17:49 am »

There's nothing stopping you from using Bullet in a 2D manner. It is slightly more difficult but entirely doable. Just lock one axis.
Logged

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #843 on: January 28, 2011, 09:29:03 pm »

Hey, I was planning on starting a new semi-serious game project in C#, and I was wondering which of Visual Studio's project templates would be the best choice, or if it even matters which one I choose.
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

Blank Expression

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #844 on: January 29, 2011, 03:07:56 am »

It doesn't, though you'll likely find it easiest to put most of your logic in a class library nd put the bare minimum of code necessary to stand the game up and interact with your engine core in a Windows or Console application. (The only practical difference between the two is the auto-use of [STAThread] on the Windows one, but you can do that on your own, and the toggling of the console window's display. You can set an application to Console for debug/testing and switch it over for a release without a problem, for example.
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #845 on: January 29, 2011, 06:26:11 am »

I was messing around with bitwise operators and stuff, and I decided to try and write a NAND adder and subtractor.
The adder works fine, but I'm having trouble getting two's complement when subtracting (I understand all I need to subtract a from b is add c and b, where c is two's complement for a). Here's what I've got. sub(6, 3) returns 13 for some reason.
Help?

e, rewrote sub(a,b) as "sub(a,b) { return add( add(a, NOT(b)), 1); }" (a + ~b + 1). Now sub(6,3) gives 3, and sub(3,6) gives 13.
« Last Edit: January 29, 2011, 08:19:38 am by ILikePie »
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #846 on: January 29, 2011, 05:10:21 pm »

Your current definition of sub is giving you -a + b, is that intended? Arg I failed to see your edit, ignore this.


Anyway, you're working in 4 bit, first one's the sign bit. That means that 13 is definitely overflow. 13 in 4-bit binary is 1101, which is equal to -8 + 5 = -3 in 2's complement. In other words, while you're working in 2's complement, you're reporting unsigned results, hence the weird result.
« Last Edit: January 29, 2011, 05:14:00 pm by Virex »
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #847 on: January 30, 2011, 09:12:54 am »

Yep, that was definitely it. Moved it up to 8 bits and it says that 0 - 1 = 255. Thanks.
« Last Edit: January 30, 2011, 09:24:17 am by ILikePie »
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #848 on: February 06, 2011, 09:35:24 am »

Spoiler (click to show/hide)
e, Never mind, it appears I need a color table as my bits per pixel are higher than 8. I was going to write this in at some point, so I guess I can start now.
« Last Edit: February 06, 2011, 11:28:47 am by ILikePie »
Logged

lordnincompoop

  • Bay Watcher
  • Allusionist
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #849 on: February 06, 2011, 11:47:46 am »

Well, I keep getting the error LNK2005 (linking error from VS2010) but all my header guards are correct and I haven't repeated anything relevant as far as I can tell. What am I doing wrong?

Also, is there any library that can handle some basic guis maybe and inserting of pictures, but still allows easy text i/o?
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #850 on: February 06, 2011, 01:11:14 pm »

Is the order ok?
"A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++"
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #851 on: February 06, 2011, 01:21:35 pm »

Ah, good old LNK2005 error.

Are you #include'ing .cpp files by any chance?
« Last Edit: February 06, 2011, 01:23:14 pm by alway »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #852 on: February 06, 2011, 02:29:08 pm »

Is there an easy way of doing if(a < b < c){} in C++?
Right now I think it's doing a (a<b == true and true == 1) and ( 1 < c ).

I'm trying to ascertain whether all 8 corners of a cube have a "value x" that is above or below a threshold, and I want to take action as soon as one of them is "on the other side".


Right now I've got this:
Code: [Select]
   
//cur2 is the length of the side of the cube, goOn is a bool, false by default
    float a = -9999.f;
    float b = cutoff;
    if(sample(x, y, z) < cutoff){ a = cutoff; b = 9999.f; }

    if(!goOn && (a<sample(x+cur2, y, z)<b)){goOn = true;}
    if(!goOn && (a<sample(x, y, z+cur2)<b)){goOn = true;}
    if(!goOn && (a<sample(x+cur2, y, z+cur2)<b)){goOn = true;}
    if(!goOn && (a<sample(x, y+cur2, z)<b)){goOn = true;}
    if(!goOn && (a<sample(x+cur2, y+cur2, z)<b)){goOn = true;}
    if(!goOn && (a<sample(x+cur2, y+cur2, z+cur2)<b)){goOn = true;}
    if(!goOn && (a<sample(x, y+cur2, z+cur2)<b)){goOn = true;}
Any good ideas?
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #853 on: February 06, 2011, 02:52:20 pm »

Tried (a<b && b<c) yet?
Logged

lordnincompoop

  • Bay Watcher
  • Allusionist
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Initiative
« Reply #854 on: February 06, 2011, 03:01:11 pm »

Ah, good old LNK2005 error.

Are you #include'ing .cpp files by any chance?

Nope.

Is the order ok?
"A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++"

I don't think I'm using either one.
Logged
Pages: 1 ... 55 56 [57] 58 59 ... 78