Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 May 2006
Offline Last Active Jun 20 2016 06:04 AM

#4960295 Interleaved Arrays

Posted by on 17 July 2012 - 08:02 PM

Figured this out. In line 43 of my second code snip, notice anything wrong there? I bind the vertex buffer again, and give it the index data. No wonder nothing was getting rendered, and my vertex buffer was corrupted.

What tipped me off, as I was just about to call it a night, i was staring at the Vertex Buffer Objects node in gDEBugger, and noticed VBO2 said something to the effect of 'not attached'. Not attached? And why is my index data showing up in VBO1 if I'm setting data in the vertex buffer first, I would think the index data would be in VBO2.

Thanks to Neilo and Brother Bob though for pointing out VAOs. They are pretty slick.

#4912466 Boost.Python loading from script

Posted by on 12 February 2012 - 10:00 PM

I have solved the problem, if you look at the error I posted, the line where I try to call

Core.Object.__init__self(id) should read


With that, I'm moving on for now, but still wondering if my approach here is valid, or if there is a better way. I'm thinking a possible strategy for controlling entities would be to have base classes defined in C++, for example a Controller class that receives events from an event system, and provides virtual methods for handling those events. I could then have classes defined in Python scripts that would inherit from this Controller class, and implement logic for different controllers in the Python scripts. It may also be possible to change a Controller's behavior at runtime by associating a different Python script with it to change it's behavior, or change an entity's controller altogether.

I'm still in the investigation stages of incorporating scripting, so some of that may be way off, but I do know it gets old incrementing a value by 10, recompiling and relaunching my program only to see it not have any effect, then rinsing and repeating a hundred times, so a scripting console is definitely a feature I'm after here as well.

#4896677 Hard Time Programming!

Posted by on 22 December 2011 - 05:26 PM

I know how the language functions (C# and Java) but as soon as i have to program something myself, everything i've learned so far, just disappears from my head.
I just sit there thinking.
What do i do?

I used to be like this too. I knew the concepts and the language, just couldn't get the code together to do what I wanted it to do. It feels like my brain doesn't have enough stack space to keep everything straight. Like has been suggested, repetition helps with that. I'll also second someone else's suggesting of drawing pictures.

I installed a 36"x48" whiteboard on the wall right beside my computer chair, and I never try to code anything without having first drawn it up on the board. I don't worry about proper sequence diagrams or uml or any of that stuff, I just get whatever's in my head onto the board, usually just a bunch of notes with arrows connecting related notes. It ends up being an unintelligible mess to anyone else, but for me it makes perfect sense. Iteration is key, once you have thought through something and drawn it, go back over the whole thing again, refining, thinking about more details of your notes, organizing, start pulling out classes, relationships and dependencies from your ideas. Eventually you can start to ask questions like 'What if I made this a class, and this a class and these two talked to each other, and this one had an instance of this one inside it..." At this point you might be tempted to just go start coding, but don't, try to come up with at least two ways of doing something, and weigh the pros and cons of each way, considering how it will change other classes in the system. If you have enough patience and discipline, the actual coding should be a formality, just follow your design from the whiteboard and type it in.

Unfortunately this is easier typed than actually done. Its way too easy to just scratch a few notes on the board, then think "I got this, time to code." Only to spend days or worse, weeks, coding only to find you didn't think of a particularly problematic condition that could happen, and have to redesign 'on the fly'. If you fall into this pit, you will often spend more time redesigning than you would have doing a proper design in the first place. However, the fight to get yourself out of this pit will be an extremely valuable learning experience, so don't just bail out and start over again.

You need to repeat this entire process alot. Do this enough, and you'll have gained experience, that magical thing that makes people better at doing stuff. With enough experience you'll become much quicker at translating a problem into code to solve the problem.

With all that being said, take it with a grain of salt. It may work great for you, it may confuse you even more. Everyone's brain works differently. Read about how others solve problems. Read tons of their code, read it like other people read fiction. Try different things, keep the ones that work, and try to improve the ones that don't.

#4756415 What Does Everyone Think About The New Site Layout?

Posted by on 09 January 2011 - 08:04 PM

...And the sig spam has already begun: horror

We either need to disallow images in signatures or add some kind of setting to let us block them in sigs only. Otherwise I'm going to have to start turning off signatures altogether, which I don't really want to do.

+1 for disallowing images in signatures. That's what I liked about the old GDNet forums, very clean and unpolluted by that kind of <expletive rant removed>. It kept things focused on the actual discussion.