Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

194 Neutral

About ferr

  • Rank
  1. That's because if your game is a trendsetter, and doing too much new stuff at once, it is forced to teach users either game-generic language, or genre-specific language. By "language" I mean visual cues, words, input patterns, and other tropes. There's a language to movies, books, and many other forms of media, and there's certainly language to games as well. Some games take advantage of the language built up by the thousands of games that came before it, and only have to introduce one or two new concepts. Other games introduce so many new concepts, that they have to do more player-guiding to get the player to understand it all. This ofcourse can create a larger difficulty curve for people who are just getting into gaming for the first time, or just getting into a specific genre for the first time, and aren't yet genre-savvy.     To clarify, I mean that levels of complexity might be interpreted differently within a given design team, not from player to player. So if Bob and Tom are making Game X, and have been given a budget of 10 complexity points, Bob might perceive some of Tom's ideas as more complex than Tom would, and vice versa.   Garfield's point is to treat complexity as if were quantifiable, however this isn't something that's in any way tangible and would crop up issues. I'm not going to say I disagree with Richard Garfield (because he's Richard Garfield), just laying out an observation on this method.
  2. hmm, my problem with this would be that the complexity "unit" is definitely subjective. What's 1 unit to someone might be 5 units to someone else, be it from experience with existing games/etc. e.g. It's simple enough to explain the concepts in a 4X to someone who's been playing them for years as to opposed to someone who is brand new to the genre.
  3.   Seconded.  I've tried a lot of Javascript IDEs but WebStorm stands out above all the others.     If you want free then its probably a toss up between Aptana or Netbeans.     Thirded. I found WebStorm to be super awesome when working on a MEANjs powered game. The code lived on linux, but I worked on my Windows machine and connected to it seamlessly with WebStorm.
  4.   Well, I'm sold on client-side/server-side prediction/assumptions.   And I guess the server doesn't need to know that the client is holding down 'W', it just needs to know that it was pressed, and can assume that it is still pressed until it receives an update for onKeyUp event/etc or some other method to cancel the 'W' action. So it will therefore not be bombarded with updates of "user is pressing W". May as well just send a playerMoved('forward') each time though.
  5. What are some methods for preventing users from tampering with game properties (i.e. hacking the game) in Javascript based games?   Consider the game to be a Javascript-based (MEAN stack) multiplayer RPG where you can walk around a map, open chests, etc.   Properties are stored server-side. These properties include things about a character's state such as: current position, current HP, items in inventory, etc. Updates to the server are performed to save client property changes (i.e. character position changed, picked up an item, etc).   As a game hacker, I could modify the properties on the client side so that when the game saves to the server, it saves my modified properties (i.e. set game.player.hp = 99999). Btw, I don't believe that using things like revealing module pattern could prevent access to 'private' properties, it would just make it a bit more difficult as it could be re-instantiated by the hacker.   How can this be prevented? What are the best practices?   I have read that server-side validation is required to prevent forgery. This might require recording a "transaction tape" of commands since the last update, then simulating these commands and assessing their validity against the game's rules. This validation seems like it would be extremely difficult to perfect.   I wonder if there could be some sort of token service that is passed from the server to the client to guarantee that an update is coming from an authorized source. However I feel like this would have enough client-side interaction that would allow a hacker to emulate this process and circumvent it.   The other option would be to leave every single property update to the server on every single modification (no timed polling or anything). For example, not just upon opening a treasure chest, but even on player movement. If the player presses 'W' to move forward, it would execute a function playerMove('forward') which sends up to the server for validation/storage. Infrequent changes like opening a chest would be simple in this model, but frequent changes, like player movement, don't seem feasible.
  6. With 6 months, I wouldn't go all out. You should begin by making the initial town, then continue building dungeons until you feel you're running low on time. Don't set out to have 16 dungeons, only to find out that you have 8 more dungeons to build with 1 week left. Don't get too complex, keep it linear. I had a similar project early on in CS classes. I spent maybe 4 weeks developing an RPG using a proprietary C++ 2D graphics engine, that essentially just made drawing shapes on a screen easy, while all input was done through a console. In that amount of time I was able to put together, - A main town with a quest giver, a shop to buy/sell items, and an inn to rest/save - Two dungeons that connected from the first town, each dungeon was unlocked via the quest giver, and bosses were unlocked via the quest giver. Really simple game, and it was pretty intensive over those 4 weeks. I did one later with C++ and DirectX that took about 3 weeks. Had a similar scale with a town/shop/quests, an overworld "dungeon" and a castle that acted as a final dungeon. Both of these games had an FF-like turn-based battle system which is very easy to develop. All of the areas in these games were scratched down on paper beforehand. I had notes in these drafts that indicated locations of quest givers, shops, etc. If there were mobs on the map, the area would be indicated by mob level and would help me figure out how to distribute enemy levels throughout the maps while keeping up with the player's level based on the likely number of mob encounters (all FF-like random encounters) and level-up opportunities. There was an old article with a guy putting together a pretty nice RPG (more in the style of Diablo I think) using Python, and doing it all in a week with no budget. http://www.gamedev.n...no-budget-r2259 Maybe you can get some pointers from him to help expedite certain areas of your project.
  7. In the Win Phone 7 version of Silverlight, I am trying to animate the FontSize property of a TextBlock. I am getting an unhelpful error that I usually get when I specify a property that a dependency doesn't contain. Code looks like this, //animate text size DoubleAnimation da = new DoubleAnimation(); da.Duration = new Duration(TimeSpan.FromSeconds(4.0)); da.From = 10; da.To = 30; Storyboard sbText = new Storyboard(); sbText.Duration = TimeSpan.FromSeconds(4.0); Storyboard.SetTarget(da, gameResult); Storyboard.SetTargetProperty(da, new PropertyPath(FontSizeProperty)); sbText.Children.Add(da); sbText.Begin(); //Unhelpful error on this call gameResult.Text = "Player Busted!"; Are there a lot of issues with property animations like this? Another thing I was trying to do was animate a Margin property of an Image, but there is no MarginProperty (and the MSDN docs note that it's missing). [Edited by - ferr on May 8, 2010 7:36:28 PM]
  8. Kind of narrowing down what exactly is causing the problem. When I call WebClient.DownloadFileAsync it seems to prevent updates to the page until the download is complete. So.. if I have a function that sets the Text of a label to the current time, then makes the call to DownloadFileAsync, the text for the label isn't changed until after the download finishes.
  9. Are there compatibility issues with DataList that prevent it from being ajaxical? I have an asp:LinkButton inside a DataList and I would like for this linkbutton to set a Panel's visibility to true and then update the text of a label within that panel. Doesn't seem to work. I have a similar question posted in the .net forum (here) but I think it might be more appropriate to ask it in this forum.
  10. I have an asp:DataList with data in it including an asp:LinkButton that fires the DataList's item command handler which uses the WebClient.DownloadFileAsync method. I have a WebClient DownloadProgressChanged handler that I want to use to update an asp:Label asynchronously with the ProgressPercentage. I tried putting the label inside of an UpdatePanel, tried putting both the DataList and Label inside the UpdatePanel, and so forth, with no luck. The text on the page for the label does not change, even though when I debug into the DownloadProgressChanged handler the label is being updated accordingly. I know that there are a number of controls that are incompatible with UpdatePanel, I'm wondering if somewhere in this process something is suffering from a limitation. Or is it something else? I added in a button to test out if ajax was working at all, and I was able to update a label ajaxically. With that in mind I decided to switch out the LinkButton in the DataList with a regular Button, which should be compatible, and within the DataList's item command handler I tried updatng a label, but nothing happened. So I'm leaning towards the problem being with the DataList component. public void DataList1_ItemCommand(object source, DataListCommandEventArgs e) { pnlTransfer.Visible = true; #region instr1 #endregion if (!System.IO.File.Exists(filename)) { pnlVideoPlayer.Visible = false; pnlTransfer.Visible = true; wc.DownloadFileAsync(vUrl, filename); } else { pnlVideoPlayer.Visible = true; pnlTransfer.Visible = false; } } void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { lblTransfer.Text = "Transferring: " + e.ProgressPercentage.ToString() + "%"; } <div id="video_list_div" style="position:absolute; width:300px; top:30px; height:auto"> <asp:Panel ID="pnlVideoList" runat="server" style="margin-top: 22px" Width="495px" BackColor=LightGray Visible=false> <asp:DataList id="DataList1" runat="server" BorderColor="black" CellPadding="3" Font-Names="Verdana" Font-Size="8pt" HeaderStyle-BackColor="#aaaadd" AlternatingItemStyle-BackColor="Gainsboro" OnItemCommand="DataList1_ItemCommand" Width=100% > <HeaderTemplate> Videos </HeaderTemplate> <ItemTemplate> <hr /> <%# DataBinder.Eval(Container.DataItem, "StringValue") %> <asp:linkbutton ID="Linkbutton2" Text="[Play]" CommandName='<%# DataBinder.Eval(Container.DataItem, "ID") %>' style="color:Black;font:8pt tahoma" runat="server"/><br /> <hr /> </ItemTemplate> </asp:DataList> </asp:Panel> </div> ... <div id="transferring_div" style="position:absolute; left:700px; top:170px;"> <asp:Panel ID="pnlTransfer" runat="server" Visible=false> <asp:Label ID="lblTransfer" runat="server" Text="11"></asp:Label> </asp:Panel> </div> </ContentTemplate> </asp:UpdatePanel> [Edited by - ferr on November 9, 2008 2:13:22 AM]
  11. Quote:Original post by remigius Quote:Original post by ferr I actually ran into a post (which I couldn't find further confirmation for) that said something to the nature of XNA storing texture color in 8 byte data and that you would need to supply an array to GetData that has a size of Height*Width/2 (didn't work). Here's the thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=981013&SiteID=1 Seems there's something about the texture you retrieve from RenderTarget2D that is not easily compatible with GetData. You *could* store the data in 8 bytes (instead of the 4 byte int), but that's probably even more counter-intuitive than using an int in the first place. Key here is that XNA doesn't care about what format you want to put your data in, as long as there's enough room. You could for example also use an array of Height*Width*4 bytes. But with the default SurfaceFormate.Color using 32 bits per pixel, a 32 bit int is probably the most logical choice. I can imagine 8 bytes being useful for more exotic formats, but with that array size of Height*Width/2 I think it's just abusing the leniency of XNA. Anyway, I wrote up a quick test and the code below seems to be working. Your snippet seems to be missing the creation code for deepCopyTexture, could you post that? RenderTarget2D rt2d = new RenderTarget2D(GraphicsDevice, 800, 600, 1, SurfaceFormat.Color); GraphicsDevice.SetRenderTarget(0, rt2d); GraphicsDevice.Clear(Color.Red); GraphicsDevice.SetRenderTarget(0, null); Texture2D t2d = rt2d.GetTexture(); int[] data = new int[800 * 600]; t2d.GetData<int>(data); With deepCopyTexture's creation code I planned to just cross that bridge when I got there. You've got GetData working with the texture from a RenderTexture2D, that was my problem, I'll test out that code with SurfaceFormat.Color when I can get back to my code. I ended up using something that seems a little simpler, though. I'm just creating a Texture from device.ResolveBackBuffer() and adding the returned Texture to my list. It seems to work fine for what I'm trying to do.
  12. Quote:As for your error, I don't know why the Color struct doesn't work (seeing it's basically a uint), but you could try using an int/uint as the type for the Get/SetData() calls and the temporary array. Assuming the texture format you're using is 32 bit per pixel, any 32 bit value type like int will work. It's also possible to extract color data from these ints, but I'll spare you that mess since it looks like you don't need it So to recap, this should work: int[] textureData = new int[originalTexture.Width * originalTexture.Height]; originalTexture.GetData<int>(textureData); deepCopyTexture.SetData<int>(textureData); Thanks for your help. I had tried using GetData with Color, uint, and Int32. I'll mess around with other types later to see if that's the problem. The thing that bugs me is that there are a handful of tutorials out there showing off how to use GetData (although I can't find a single one that is getting data from a RenderTarget2D's texture) and they use either Color, uint, or Int32. I actually ran into a post (which I couldn't find further confirmation for) that said something to the nature of XNA storing texture color in 8 byte data and that you would need to supply an array to GetData that has a size of Height*Width/2 (didn't work). Here's the thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=981013&SiteID=1 Seems there's something about the texture you retrieve from RenderTarget2D that is not easily compatible with GetData.
  13. I'm trying to create a List<> of Texture2D's from RenderTarget2D.GetTexture() so that I can [do something with all of the textures] after the scene has finished rendering. There is a shallow copy issue with simply adding the texture to the list, so I'm thinking using Texture2D.GetData<> is the only way to deep copy it over. There is a problem with this, though, from an MS article: Quote:On Windows, GetData and SetData will fail if Texture2D.ResourceManagementMode is ResourceManagementMode.Manual and the format cannot be used as a render target. Is the second part of the sentence conditional on the first or are they just randomly saying that RenderTarget2D textures are incompatible with GetData? I'm getting "The type you are using for T in this method is an invalid size for this resource." when trying to call GetData. On top of that they removed ResourceManagementMode from XNA with the release of 2.0, and apparently replaced it with TextureUsage and BufferUsage. PresentationParameters pp = device.PresentationParameters; renderTarget = new RenderTarget2D(device, pp.BackBufferWidth, pp.BackBufferHeight, 1, device.DisplayMode.Format); ... Texture2D deepCopyTexture = null; Texture2D originalTexture = renderTarget.GetTexture(); //RenderTarget2D Color[] textureData = new Color[originalTexture.Width * originalTexture.Height]; originalTexture.GetData<Color>(textureData); deepCopyTexture.SetData<Color>(textureData); I messed around with the Type GetData uses a lot to see if it's something as simple as that, but it's always the same error.. Noticed this in one of the GetData articles: Quote:An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the GetData or SetData methods) a resource that is currently set on a graphics device. I call device.SetRenderTarget(0, null); before GetData so I don't think that's the issue. [Edited by - ferr on July 29, 2008 11:05:39 PM]
  14. Quote:Original post by kanato If you have a huge amount of data, you might want to consider using the ListView in virtual mode instead of pushing all the data into it. http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.virtualmode.aspx Yes, I tried that out a bit ago.. it worked fine for certain cases, but it is just so strange at times. It seemed to want to call its retrieval callback at the oddest times, and it was screwing things up. What I ended up doing was just creating a list of ListViewItems (or an array of them, don't recall) and just adding them to the ListView using the AddRange method. A new problem has popped up, and I believe it's related enough to this thread that I don't need to create a new topic. I've got an Invoke inside of a worker thread, my user 'cancels' the action which fires a thread.Abort() and closes the form once aborted, however it RANDOMLY crashes and complains about the Invoke call still trying to go through, and that it cannot access the disposed objects. Try/Catch doesn't seem to help avoid this error, it's a crash-to-desktop type of thing. What can be done about this? within the form closing event: if (core_threads != null) { core_threads.ForEach(delegate(System.Threading.Thread t) { if (t.ThreadState == System.Threading.ThreadState.Running) { t.Abort(); while (t.IsAlive) { } //I could probably do t.Join() instead } }); } core_threads is a List<t> of Threads, each of which are instantiated in a main worker thread which exists to work away from the UI thread. When the form is closed, the main worker thread must be aborted, as well as any open core threads that do the main processing. The problem is that the UI thread has been closed before the core_thread, and that core_thread, while it is in the process of being aborted, is still running and at times may try to invoke the (closed) UI thread. the invoked method within the thread: Invoke(new MethodInvoker(delegate() { if (lvZoneInfo.Items.SubItems[1].Text != record._signature) { lvZoneInfo.Items.SubItems[1].Text = record._signature; lvZoneInfo.Items.SubItems[2].Text = (int.Parse(lvZoneInfo.Items.SubItems[2].Text) + 1).ToString(); } })); Using Invoke to update something on the UI thread lends to racing issues, that if statement bounces off race errors. Here's an article that asks pretty much the same question. I'm pretty much doing the major things that the posters comment about (like aborting the threads within the closing event), but that doesn't seem to be cutting it.. The error, note 'AccessControls_Zone' is the name of the form:Cannot access a disposed object. Object name: 'AccessControls_Zone'. [Edited by - ferr on June 23, 2008 2:54:09 PM]
  15. I just noticed that since invoke goes back to execute on the control's thread, if that thread happens to be the UI thread and it's a large execution (such as adding a large amount of items to say a ListView), it will totally ruin the purpose of using multi-threading for performance/responsiveness (in my case). Should I just skip using invoke on large UI processes (unless I'm debugging).. what's the harm? Removing invoke = very responsive UI.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!