collapse collapse

* Who's Online

  • Dot Guests: 78
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Board Stats

  • stats Total Members: 88
  • stats Total Posts: 11163
  • stats Total Topics: 1699
  • stats Total Categories: 4
  • stats Total Boards: 76
  • stats Most Online: 248

Author Topic: CALL OF THE OCEAN "FORE": Underwater Warfare  (Read 3502 times)

0 Members and 1 Guest are viewing this topic.

Offline bacon

  • Newbie
  • *
  • Posts: 16
  • Reputation 2
  • Gender: Male
  • Clever text
    • View Profile
CALL OF THE OCEAN "FORE": Underwater Warfare
« on: January 28, 2014, 08:14:14 pm »
Hey I thought you guys might be interested in the game my friend and I developed over the weekend. It's all in c89 and was quite the experience. It was part of the Global Game Jam 2014.  I'm not sure how many here participate in jams but I highly recommend it if there's one close by. Where I live there is also a state game jam in August. Anyway I hope it's at least a little fun for a few folks out there :)

Completely open source on github:
https://github.com/l3acon/GGJ2014

All comments appreciated.
« Last Edit: January 28, 2014, 08:17:07 pm by bacon »
to do: siggeh

Offline Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1437
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #1 on: February 02, 2014, 08:11:21 pm »
I see in your code you are casting the return of malloc - technically you don't need to do that see this SO article:

http://stackoverflow.com/questions/1835193/is-it-a-better-practice-to-typecast-the-pointer-returned-by-malloc

I am not the C language police so I don't care - just be aware that other "undergrad C experts" may make a comment.

There is no history of commands (ie I can't hit up to go to previous commands) - somewhat annoying but not a big deal.

There appears to be a memory leak according to valgrind

Code: [Select]
==21907== HEAP SUMMARY:
==21907==     in use at exit: 856 bytes in 22 blocks
==21907==   total heap usage: 24 allocs, 2 frees, 912 bytes allocated
==21907==
==21907== LEAK SUMMARY:
==21907==    definitely lost: 88 bytes in 10 blocks
==21907==    indirectly lost: 768 bytes in 12 blocks
==21907==      possibly lost: 0 bytes in 0 blocks
==21907==    still reachable: 0 bytes in 0 blocks
==21907==         suppressed: 0 bytes in 0 blocks
==21907== Rerun with --leak-check=full to see details of leaked memory
==21907==
==21907== For counts of detected and suppressed errors, rerun with: -v
==21907== Use --track-origins=yes to see where uninitialised values come from
==21907== ERROR SUMMARY: 60 errors from 10 contexts (suppressed: 11 from 6)
Projects:
[ Axios Engine ] [ sourcehub ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Offline bacon

  • Newbie
  • *
  • Posts: 16
  • Reputation 2
  • Gender: Male
  • Clever text
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #2 on: February 02, 2014, 11:00:44 pm »
Ahh that makes a lot of sense. Thanks for the heads up, I just assumed it was part of the things we had to do with the strict compiler options. And yeah, we knew about the memory leak but weren't sure where it was. Do you know how we might try and find it?
to do: siggeh

Offline Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1437
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #3 on: February 03, 2014, 10:17:34 pm »
Ahh that makes a lot of sense. Thanks for the heads up, I just assumed it was part of the things we had to do with the strict compiler options. And yeah, we knew about the memory leak but weren't sure where it was. Do you know how we might try and find it?

valgrind would be able to help you. If you are using Linux it should be in your repos.
Projects:
[ Axios Engine ] [ sourcehub ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Offline Vlykarye

  • Full Member
  • ***
  • Posts: 131
  • Reputation 34
  • Gender: Male
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #4 on: March 04, 2014, 07:35:40 pm »
I participated in the NYU game jam. My team got nominated for best use of theme, but we weren't picked for the award. I partly think it was our speaker's fault, but for my first year it was still nice. I'm gonna check out your game.

Offline Vlykarye

  • Full Member
  • ***
  • Posts: 131
  • Reputation 34
  • Gender: Male
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #5 on: March 04, 2014, 07:38:22 pm »
Wait, can I play this on Windows? :(
I don't 'really' want to set up a linux..

Offline Vlykarye

  • Full Member
  • ***
  • Posts: 131
  • Reputation 34
  • Gender: Male
    • View Profile
Re: CALL OF THE OCEAN "FORE": Underwater Warfare
« Reply #6 on: March 04, 2014, 08:14:53 pm »
I have a question. In the ABS macro, it takes a variable and negates it correct? However, 'heading' is an unsigned integer, so the logic here seems incorrect. But is it?

 

Donate


* Search


* Recent Posts

Image Comparison by Shishka
[May 15, 2017, 01:18:02 pm]


Re: srchub - free source code hosting by Nathan
[December 14, 2015, 11:37:02 pm]


Re: srchub - free source code hosting by Celestialkey
[November 27, 2015, 08:51:42 am]


Updates by Nathan
[October 30, 2015, 08:27:36 pm]


Re: Client-Server Messaging by Nathan
[October 25, 2015, 05:48:57 pm]