• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
lomateron

who has the biggest score

8 posts in this topic

In D3D10

I will render around 100,000 vertex with one VertexBuffer of just one vertice using DrawInstanced(), D3D10_PRIMITIVE_TOPOLOGY_POINTLIST

the output of the vertex shader is a random ID the can go from 0 to 2^32, and a random score that can go from 0 to 2^32

Various vertex can output the same ID, the total score of the ID is the sum of all scores with the same ID

I want to know which ID has the highest score, just using the GPU

Edited by lomateron
0

Share this post


Link to post
Share on other sites

This sounds an awful lot like homework so I'm going to err on the side of caution and give hints.

 

With 2^32 people and 2^32 possible scores, you need an awful lot more than 64mb to store everything: it's nearer 16gb.  You don't want to do that.

 

You only need to track two numbers: what the current highest score is, and who has it.  Initialize the current highest score to 0, the number of the person who has it doesn't need to be initialized (because nobody has a score yet).

 

Then run your tests.

 

Each test that's run, once the result is in, compare the score with the current highest.  If it's higher, then store it as the new current highest and store the id of the person.

 

When all tests have completed you have your result.

 

Doing this on the GPU, you can use D3DBLENDOP_MAX (for 9)  or D3D11_BLEND_OP_MAX (for 11) combined with render-to-texture to do the comparison.

0

Share this post


Link to post
Share on other sites

Doing this on the GPU, you can use D3DBLENDOP_MAX (for 9)  or D3D11_BLEND_OP_MAX (for 11) combined with render-to-texture to do the comparison.

 

Nop, that can't be done, because every person takes various test, and In the GPU I can put every test in a vertex shader, who makes the test and how much score it gets is random. for example lets say I have a texture with every person and its individual scores, every pixel represents a person with its score, the vertex shader will render points to random pixels, that means I will give a test to random people and this people will get random scores from that test.

 

it's no homeowork

0

Share this post


Link to post
Share on other sites

Is it being down voted because you think I am asking homework question? it is not

The original problem I am trying to solve doesn't has to do anything with people and scores, I related the problem to people and scores expecting you will see some familiarity with the problem.

I already solved the original problem by changing some basic things of the problem which changes the original problem, but i would still like to see what people think about this one

0

Share this post


Link to post
Share on other sites

whut, can I know why the downvotes?

 

downwotes are not much wise on this forum anyone can dovnvote you for any reason - perfect recipe for downvotes here is to say something that mas of readers disagree (it can be for example to much wise and you will be downwoted) - recipe for upvotes is say something extreamlly easy to read banal and lame and make readers wanted to easy agree with that ;/ you will get click-click just like in ant-hill

Edited by fir
-1

Share this post


Link to post
Share on other sites

Do you really have 232 objects active at the same time? And each of them needs a 4-byte score variable?

That's 16 gigabytes of RAM just to store the score variable for all those players!!

Or do you have a smaller number of objects, but they use 32-bit identifiers?

 

If you do have gigabytes worth of 'players' active at once, then there's no simple answer. You'll have to operate on them in batches, moving the data between GPU-RAM, system RAM and disk caches...

 

If you've got a smaller number of objects per-frame, but they use 32-bit identifiers, then you can first do a remapping pass that generates linear indexes (0,1,2...) for each object that is going to be used this frame, or you can use a hash-map to store the scores for the active objects.

 

Are you targetting Dx9, 10 or 11 level hardware?

 

I would guess your OP got downvoted because it's written in a very confusing way, making it hard to help you? I can tell you that the people who downvoted it (so far) haven't actually posted in this thread though.

Edited by Hodgman
0

Share this post


Link to post
Share on other sites

Is it being down voted because you think I am asking homework question? it is not

 

Just to clarify, I didn't say I thought it was homework, I said it sounds like homework (in other words I suspected that it might have been homework), and the reason why was the way the question was written.  The terse statement of the problem, the seemingly arbitrary memory constraint, the requirement to use two passes: when you see enough homework questions you get to recognise the writing style and other elements.  However, and for the record, I'm not one of those who downvoted because I do recognise sufficient doubt (in other words, I accept that my suspicion may have been wrong).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0