• 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.

CPPNick

Members
  • Content count

    326
  • Joined

  • Last visited

Community Reputation

100 Neutral

About CPPNick

  • Rank
    Member
  1. Phew! done. here is the code if anyone wants to take a look. rollout new "Edgemap Exporter" ( label lab "Export Edgemap" button btn_export "Export" on btn_export pressed do ( s = objects as array theLines = for o in s where classof o == Line collect o theCircles = for o in s where classof o == Circle collect o nLines = theLines.count nCirlces = theCircles.count if(nLines != 0 or nCircles != 0) then ( out_name = getSaveFileName types: "Edge Map(*.emap) |*.emap|" out_file = createfile out_name -- make an array to hold all the line segments segArray = #() if(nLines > 0) then ( for aLine = 1 to nLines do ( -- for each spline in the Line object thisLine = theLines[aLine] nSplines = numSplines thisLine for aSpline = 1 to nSplines do ( nKnots = numKnots thisLine aSpline if(isClosed thisLine aSpline) then ( if(nKnots > 1) then ( pt1 = getKnotPoint thisLine aSpline nKnots pt2 = getKnotPoint thisLine aSpline 1 append segArray #(pt1, pt2) if(nKnots > 2) then ( for aKnot = 2 to nKnots do ( pt1 = getKnotPoint thisLine aSpline (aKnot - 1) pt2 = getKnotPoint thisLine aSpline aKnot append segArray #(pt1, pt2) ) ) ) ) else ( if(nKnots > 1) then ( for aKnot = 2 to nKnots do ( pt1 = getKnotPoint thisLine aSpline (aKnot - 1) pt2 = getKnotPoint thisLine aSpline aKnot append segArray #(pt1, pt2) ) ) ) ) ) format "%\n" segArray.count to:out_file for thisSeg = 1 to segArray.count do ( format "% % % %\n" (segArray[thisSeg][1].x) (segArray[thisSeg][1].y) (segArray[thisSeg][2].x) (segArray[thisSeg][2].y) to:out_file ) ) if(nCircles != 0) then ( format "%\n" nCirlces to:out_file for i = 1 to nCirlces do ( Circle1 = theCircles[i] format "% % %\n" (Circle1.center.x) (Circle1.center.y) (Circle1.radius) to:out_file ) ) -- close out_file ) ) ) CreateDialog new
  2. getting closer! rollout new "Edgemap Exporter" ( label lab "Export Edgemap" button btn_export "Export" on btn_export pressed do ( s = objects as array theLines = for o in s where classof o == Line collect o theCircles = for o in s where classof o == Circle collect o nLines = theLines.count nCirlces = theCircles.count if(nLines != 0 or nCircles != 0) then ( //-- out_name = getSaveFileName types: "Edge Map(*.emap) |*.emap|" //-- out_file = createfile out_name // -- make an array to hold all the line segments // --segArray = #() for aLine = 1 to nLines do ( // -- for each spline in the Line object thisSpline = theLines[aLine] nSplines = numSplines thisSpline for aSpline = 1 to nSplines do ( nSegments = numSegments thisSpline aSpline for aSeg = 1 to nSegments do ( print "This is a segment!" ) ) ) //-- if(nCircles != 0) then //-- ( //-- format "%\n" nCirlces to:out_file //-- for i = 1 to nCirlces do //-- ( //-- Circle1 = theCircles[i] //-- format "% % %\n" (Circle1.center.x) (Circle1.center.y) (Circle1.radius) to:out_file //-- ) //-- ) //-- close out_file ) ) ) CreateDialog new just cant figure out how to retrieve the vertices from the segment =/
  3. I need some help with this thing that I am making for a school project. I need to get a map of edges out of max to use for collision detection in our game. This is what I have so far. rollout new "Edgemap Exporter" ( label lab "Export Edgemap" button btn_export "Export" on btn_export pressed do ( out_name = getSaveFileName types: "Edge Map(*.emap) |*.emap|" out_file = createfile out_name edgemap = snapshotAsMesh selection[1] --I need to get a list of the edges of the object here --num_verts = edgemap.numEdges --format "%\n" num_verts to:out_file --vert1 = getVert tmesh num_verts --vert2 = getVert tmesh 1 --format "% % % %\n" (vert1.x) (vert1.y) (vert2.x) (vert2.y) to:out_file --for v = 2 to num_verts do --( --vert1 = getVert tmesh v - 1 --vert2 = getVert tmesh v --format "% % % %\n" (vert1.x) (vert1.y) (vert2.x) (vert2.y) to:out_file --) close out_file ) ) CreateDialog new I have got the thing saving a file properly and everything, but I need a way to get a list of all the edges of a spline(with all corners). can anyone point me in the right direction? thanks for any help on this.
  4. Quote:Checking distance between frames / seconds. I think Modern Warefare 2 uses this method.. A friend of mine had a cheat, so naturally I wanted to see if it actually worked(not recommended, you may lose your account permanently) but the speed cheat only worked when we played on a "hacked server" which allowed it. If you tried the hack in a regular game, you would see yourself jolting back and forth like the server was resetting your position when it saw that you had moved impossibly far for that amount of time. Quote:Players who are impossibly good end up playing against each other, which means that cheaters play other cheaters. pretty sure mw2 does this too. [Edited by - CPPNick on September 19, 2010 8:55:35 PM]
  5. Do you know how this problem will be handled in the future then? Does the IPv6 protocol address this somehow? I imagine that all it would take to overcome this would be to update the TCP/IP packet header to also contain a private network IP. anyways, imo, if people download illegally cracked software, and get a trojan, that should be their problem...and as far as operating systems go, I would rather click "allow" for each incoming or outgoing connection then have to deal with virus scanners or firewalls.. people take computers for granted way to easily... I am not going to try and start a flame war here, but I hope that the new EHF fees they are imposing on computer products in Canada are just the beginning. There should be laws that protect people's rights to use their technology. If I can get a ticket for speeding, why not for spamming ? :)
  6. I'm really surprised I didn't get any answers for this. Anyways, it works now. I edited the code above to reflect the newest, working code, for uPnP (automatic port forwarding).
  7. Hi, I need a little help with uPnP if anyone can spare a minute. I wanted to learn socket programming, so I made a nice little web server that uses IO completion ports and all that good stuff. When I forward the port manually from within the my router's settings, the server runs fine. I recently tried to get it to work with uPnP, but had no luck. I tried connecting to the server from outside my home network, but couldn't get a response. I checked that: 1) uPnP is enabled in the router's settings 2) I am not receiving any errors from my code This is the code for the wrapper that I made: mappedport.h #ifndef INC_MAPPEDPORT_H #define INC_MAPPEDPORT_H #pragma comment (lib, "ws2_32.lib") #include <winsock2.h> #include <ws2tcpip.h> #include <Natupnp.h> #include <Windows.h> class MappedPort { private: HRESULT hr; wchar_t protocol_[4]; long lport_; bool initialized_; bool mapped_; IUPnPNAT *uPnP; IStaticPortMapping *spmOut; IStaticPortMappingCollection *spmCol; bool Initialize(); public: MappedPort(); MappedPort(long lPort, wchar_t *protocol /* "TCP" or "UDP" */, wchar_t *description); ~MappedPort(); bool Map(long lPort, wchar_t *protocol /* "TCP" or "UDP" */, wchar_t *description); bool Unmap(); bool IsMapped(); }; #endif /* INC_MAPPEDPORT_H */ mappedport.cpp #include "mappedport.h" MappedPort::MappedPort() { Initialize(); } MappedPort::MappedPort(long lPort, wchar_t *protocol, wchar_t *description) { if(Initialize()) mapped_ = Map(lPort, protocol, description); } bool MappedPort::Initialize() { lport_ = 0; mapped_ = false; initialized_ = false; hr = 0; uPnP = NULL; spmOut = NULL; spmCol = NULL; if(CoInitialize(NULL) == S_OK) { hr = CoCreateInstance(__uuidof(UPnPNAT), NULL, CLSCTX_ALL, __uuidof(IUPnPNAT), (void **)&uPnP); if(hr == S_OK && uPnP != NULL) { hr = uPnP->get_StaticPortMappingCollection(&spmCol); if(hr == S_OK && spmCol != NULL) { initialized_ = true; } } } return initialized_; } MappedPort::~MappedPort() { if(mapped_) this->Unmap(); if(uPnP) uPnP->Release(); if(spmCol) spmCol->Release(); if(spmOut) spmOut->Release(); if(initialized_) CoUninitialize(); } bool MappedPort::Map(long lPort, wchar_t *protocol, wchar_t *description) { WSADATA wsaData; char hostname[256]; PHOSTENT hostinfo; wchar_t ip[16]; lport_ = lPort; wcscpy_s(protocol_, 4, protocol); if((initialized_ == true) && (mapped_ == false)) { spmCol->Remove(lport_, protocol_); if(WSAStartup(MAKEWORD(2,2), &wsaData) == 0) { if(gethostname(hostname, sizeof(hostname)) == 0) { hostinfo = gethostbyname(hostname); if(hostinfo != NULL) { if(InetNtopW(AF_INET, (struct in_addr*)*hostinfo->h_addr_list, ip, sizeof(ip)) != NULL) { if(spmCol->Add(lPort, protocol, lPort, ip, TRUE, description, &spmOut) == S_OK) { mapped_ = true; } } } } WSACleanup(); } } return mapped_; } bool MappedPort::Unmap() { return (spmCol->Remove(lport_, protocol_) == S_OK); } bool MappedPort::IsMapped() { return mapped_; } If someone could point out any obvious errors that I am making here, it would be greatly appreciated. bonus: if you can fix it, you can keep it =D thanks [Edited by - CPPNick on August 30, 2010 8:46:13 AM]
  8. I might recommend is a newer graphics card, as DirectX 11 is out now. The GTX285 only supports 10.1. The GTX 470 will out perform the 285 for about the same price. I would consider a faster CPU as well. 3.0ghz+. 4GB or ram would be fine, but the more you have, the less time you will spend waiting for your OS to dig things out of your hard drive. I only have win7 32bit, which means I'm stuck with only 3gb or ram...Alt+Tabbing out of Starcraft 2 makes me want to cry..lol If you plan on getting the i7 and then overclocking it instead of getting a faster chip, make sure you get some kind of water cooling system, and a good mother board. I use the corsair hydro series cooler..the huge elaborate ones really aren't necessary unless you are trying to go past 4ghz..which is really just for show at this point IMO. Anyways, gl with it, and remember you can always google "xxxx review" to find performance testing of most computer products and see if they are good enough for what you plan to use them for.
  9. Quote:Just ignore that article. sounds like a plan lol
  10. Quote:when you pop an element, then push a new one, you can reuse the memory of the popped element for the newly pushed one. Maybe I misunderstood what he was planning to use this for. What if he pops 3 elements, and then adds three? wouldn't that then force his code to use "new" at least two more times? Quote:after allocating N items, it is cheaper to allocate up to N items again If his app needs to pop the entire list of say, 20 items, except one element, how will he keep track of the other 19 that were allocated and reuse them? I don't see any way of reusing memory without traversing all elements looking for an empty one each time. I know an array is out of the question for a set of indeterminate size, because any kind of reallocation to add space would necessitate the copying of all the data to a new location, which can be slow.... Do you guys see what I am getting at here?
  11. I need to use a dynamic collection of objects that maintain a constant memory address in my project. In this article, the guy says that he is using an alternative to C++ "new" by using assignments instead. I don't see the significance in this article. http://www.atalasoft.com/cs/blogs/stevehawley/archive/2008/05/05/when-new-is-too-slow.aspx Firstly, this looks a lot like a simple linked list...but the writer seems think he has found some innovative way of handling his problem..even though linked lists have probably been around about as long as pointers. Secondly, I don't understand how he figures that he can avoid the overhead of allocating new space by using assignment, because before you can assign a value to anything, it first has to be allocated, i.e., using new. Can anyone clarify this a little bit for me?
  12. Thanks =D This simplifies things for me immensely.
  13. If I am using overlapped sockets with i/o completion ports, is it ok to use WSASend on a socket to send data after posting the initial WSARecv on that same socket, but before having received any data? Will the socket still receive data and trigger the completion port if I have sent data through it? Thanks, Nick
  14. The program above was just a test project. The exact problem I was having was because ifstream::read(test, 5) doesn't add a terminating '/0' and basic_string::append() takes "C-strings" which can be defined as: "Array of char[n], where n is the length of the string (in characters) plus 1 for the terminating '\0' that marks the end of the string" http://msdn.microsoft.com/en-us/library/69ze775t%28VS.80%29.aspx therefore this did not work properly: test.append(test); rather than allocate extra space though, I used the second optional argument of append() to specify a number of characters to copy, since append() would not otherwise know where to stop without the terminating '\0' test.append(test, 5); This was part of a web server, and for the HTTP response body, the web browser doesn't expect '\0' terminated strings. That is another reason I chose not to allocate the extra byte. [Edited by - CPPNick on July 23, 2010 9:38:03 AM]
  15. ok, The only place I have ever seen something like this is in an MSDN example for GetOpenFileName() I don't understand the difference between '\0' and '0' though =/ at least I have something to go on now though. Thanks, you guys are life savers. I was about to go check into the looney bin..lol