Who's up for a group challenge?

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » February 27th, 2014, 1:37 pm

LuisR14 runs the Git server and it's mostly on. He runs it on either his laptop or desktop, so there are occasions it is off. You can always join the irc channel (address and channel name is in his signature) and ask him to have it turned on and how to access it. Luis and I have discussed adding networking code in the future, just need to get to that point first. Right now I don't think it will be too much of a problem as Luis already knows how to add the code, and I think working it in to the project won't be that difficult, though since I personally don't have the experience I can't say for sure.

PS. We would love to have any one come help, I started the project in hopes that people would be able to use this for gaining experience in programming. Most already have ideas on what type of program they want to create, but for anyone not really having an idea of what to create and would like to have the experience writing code then come on over. Some have turned down the opportunity to help saying they don't have the experience level to help. Cameron and I, aren't professionals.

I started with chili's tutorials in Oct 2012. Haven't ventured out into DX API or Win API or anything, so pretty much what he has taught us and what I could pick up from cplusplus.com. Cameron as far as I know, has pretty much done the same with the exception of following the tuts from rastertek.com or directxtutorials.com to create a moving spinning textured cube. We both have used LuisR14 for help, thank you Luis.

My point being, it doesn't matter how much experience you have, to an extent I suppose. If you haven't made it through to the intermediate lessons at least, you might have troubles following the code. If that's as far as you have made it you can still make functions within classes that will help. Structs are the same as classes except you have to declare public: for those functions that you want to access from a different class or part of the program. So building classes shouldn't be that much more difficult.

The only thing that chili didn't go over about structs is that classes and structs have a special function called the constructor. It's the function that is called when the object is created, sometimes automatically, sometimes you call it manually. You'll see if you look through the project.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Who's up for a group challenge?

Post by chili » February 27th, 2014, 3:01 pm

Doesn't build... seems to be missing particle.h
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » February 27th, 2014, 6:11 pm

Doh, yeah I just cleaned it up and found out about the build issues this morning.

I corrected it.

PS, I changed some of the code even from what I uploaded before, hoping it would fix the issue, alas it hasn't.
Attachments
Shooter.zip
(4.59 MiB) Downloaded 254 times
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » February 28th, 2014, 2:43 am

Ok, so Luis found the culprit. Problem is in the Level constructors, I wrote the new commands wrong. Why it worked sometimes and other times not is kind of weird.

I had

Code: Select all

new ETrigger(0,0), sizeof(ETrigger) * numEnemyTriggers;
compiler was ok with that, but I guess it wasn't allocating the way I wanted.
I wanted

Code: Select all

new ETrigger[numEnemyTriggers]
but I didn't have any default constructors for the Trigger classes so the compiler wouldn't let me. The work around was create a Set function and just delete the params to the constructors to make them default.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Who's up for a group challenge?

Post by chili » March 1st, 2014, 6:01 am

Yeah, you can do the set function thing and that works fine. If you want to (or need to) use the constructor, the way to do it is to do this:

Code: Select all

Thing** myStuff = new Thing*[ nThings ];
for( int i = 0; i < nThings; i++ )
{
      myStuff[ i ] = new Thing( parameter );
}
Deleting works like this:

Code: Select all

for( int i = 0; i < nThings; i++ )
{
      delete myStuff[ i ];
}
delete [] myStuff;
You can also use vectors (or some other container) to do similarly.
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » March 1st, 2014, 9:17 am

Thanks chili, that's what we ended up realizing is we would have to use double pointers.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Who's up for a group challenge?

Post by LuX » March 1st, 2014, 11:47 am

Code analyzer also found a delete mistake in D3DGraphics::DrawCurve: You set up "float *x = new float [turns]; float *y = new float [turns];", and then later use "delete x; delete y;" which of course should be "delete[ ]x; delete[ ]y;"
I've also seen a lot of people set the variables as a nullptr after deleting.
ʕ •ᴥ•ʔ

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » March 1st, 2014, 11:54 pm

Thanks LuX, that function isn't used at the moment,but if I do use it at some point I'll make those changes or remove it from the project, and I have been using that same method of setting to nullptr after deleting, biggest reason I do it is because even after delete, the address is still there so do something like if( pPointer ) doesn't work correctly unless you set to NULL or nulptr. You may know that, just thought I'd share for others benefit.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
bobloblaw
Posts: 100
Joined: April 15th, 2013, 3:05 am
Location: Earth, USA, California, SF Bay Area
Contact:

Re: Who's up for a group challenge?

Post by bobloblaw » March 11th, 2014, 7:53 am

Hows the project going guys, I haven't seen an update in a while? I tried downloading the latest build from chili forums but seems I still wasn't able to get it playable through debuging. ( need to get better at that ) I always cringe when chili contemplates doing the debug for his programs off camera, I love to see other peoples process as a reflection to my own, glad he usualy choses to capture it for our viewing pleasure. One of the reasons I would be disapointed if he just posts code for us to review. Anyway, I'm rambling, good luck on the project and I look forward to a new playable build.

-bobo
Here for your Artistic needs, Pixel or Vector I love it all. Check it out - Click Me

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Who's up for a group challenge?

Post by albinopapa » March 11th, 2014, 8:29 am

Thank you Bob for the encouragement. The last post was me needing help figuring out what I was doing wrong :). We are still working on it, we started this 6 months ago and at this point, for me anyway, feel there isn't any point in rushing it any more. We are kind of having fun with learning new things about c++ and what not. Cameron has been trying to push the limits of even Luis' understanding of the language so it's been fun just to look stuff up that we wouldn't normally even know about at this point, with the exception of templates which chili covered in one of the more recent videos.

Don't know you if you did a comparison of the code from earlier posted project to latest, but it has been almost completely rewritten. As such with my limited knowledge of how to design an object oriented program, I broke it and have just recently gotten it to what it was back in October. If there is any indication between how it progressed between October and December before the overhaul, I'd say another month and we will have something almost resembling a game. :) Most of the elements are there already, so just need to finish getting it back in working order, right now it's the triggers that are being reworked, the old way was too messy to belong in even the original code.

Anyway, Cameron is working on story line and an event queuing class that we can use the triggers with. This of course adds to the depth the game wasn't originally planned to have and will extend the amount of time needed to finish, but I like the ideas he has come up with and hope we have something playable before summer.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply