Jump to content
  • Advertisement

Rich Brighton

Member
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

102 Neutral

About Rich Brighton

  • Rank
    Member

Personal Information

  • Interests
    Design
    Education
    Programming
  1. Rich Brighton

    Simultaneous turns? (turn-based strategy)

    As I see it the purpose of simultaneous turns is to focus more on strategy and less on micro management of specific combats as the range of possibilities expands massively compared to dealing with a simple dice throw. It potentially makes for a more "realistic" experience, but is a significant step up in terms of challenge for the resolution manager. The old board Game "Diplomacy" is an example of a simple simultaneous turn game.
  2. Rich Brighton

    Hexagonal movement

    This is the builder method for the North west Europe grid that you can see at: https://richstrat.com/ww2.html object EuropeWestGrid extends EGridMaker { def apply[TileT <: Tile, SideT <: TileSide](implicit fTile: (Int, Int, Terrain) => TileT, fSide: (Int, Int, SideTerr) => SideT, evTile: ClassTag[TileT], evSide: ClassTag[SideT]): EGrid80km[TileT, SideT] = { val grid: EGFarNorth[TileT, SideT] = new EGFarNorth[TileT, SideT]("WEurope", 0.east, xOffset = 200, xTileMin = 114, xTileMax = 286) grid.setTilesAll(Ocean)(fTile) grid.setSidesAll(SideNone)(fSide) grid.fSetSide(181, 477, Straits)(fSide) grid.fSetSide(205, 463, Straits)(fSide) import grid.{setRow => gs} gs(518, 230, taiga) gs(516, 232, taiga) gs(514, 230, taiga) gs(512, 232, taiga) gs(510, 230, taiga * 2) gs(508, 228, taiga * 3) gs(506, 226, taiga * 3) gs(504, 224, taiga * 4) gs(502, 218, taiga * 6) gs(500, 216, taiga * 6) gs(498, 182, taiga, sea * 7, taiga * 7) gs(496, 216, taiga * 7) gs(494, 198, taiga, sea * 3, taiga * 7) gs(492, 216, taiga * 7) gs(490, 218, taiga * 3, sea, taiga *3) gs(488, 220, taiga * 2, sea * 2, taiga * 3)//, sea * 2) gs(486, 186, hills * 2, sea * 10, plain * 3) gs(484, 180, hills * 4, sea * 10, plain * 3) gs(482, 182, hills * 3, sea * 8, plain * 2, sea, plain * 3) gs(480, 184, hills * 2, sea * 9, plain *2, sea, plain * 2) gs(478, 182, hills, plain * 3, sea * 7, plain * 2, sea, plain * 2, sea) gs(476, 176, plain * 2, sea, hills * 2, sea * 8, plain * 3, sea * 3) gs(474, 170, plain * 3, sea * 2, hills, plain, sea * 8, plain * 2, sea * 3) gs(472, 168, plain * 3, sea * 3, plain * 2, sea * 7, plain * 6) gs(470, 170, plain * 3, sea, hills * 2, plain * 2, sea * 5, plain * 8) gs(468, 168, plain * 3, sea, hills * 3, plain * 3, sea * 3, plain * 8) gs(466, 170, plain, sea * 3, hills * 2, plain * 3, sea * 2, plain * 4, hills * 2, plain * 4) gs(464, 188, plain * 5, sea, plain * 2, hills * 7, plain, hills) gs(462, 182, hills * 3, sea * 3, plain * 4, hills * 8) gs(460, 204, plain * 3, hills * 10) gs(458, 194, plain * 8, hills * 3, plain, hills * 3, plain) gs(456, 188, plain, sea, plain * 7, hills * 3, plain * 3, hills * 2) gs(454, 186, plain * 10, hills * 2, plain * 4, hills, mtain) gs(452, 192, plain * 9, hills * 2, mtain * 6) gs(450, 194, plain * 7, hills, mtain * 8) gs(448, 196, plain * 4, hills * 2, plain, mtain * 9) gs(446, 198, plain * 2, hills * 4, mtain * 3, plain * 2, mtain, plain * 2, hills * 2) grid } } I'm rather pleased with the succinctness of the syntax. the setRow method, which works on both square grids and hex grids: /** Note set Row starts with the y (row) parameter. */ final def setRow[A](yRow: Int, xStart: Int, tileValues: Multiple[A]*)(implicit f: (Int, Int, A) => TileT): Cood = { val tiles: List[A] = tileValues.toSingles tiles.iForeach{(e, i) => val x = xStart + i * xStep fSetTile(x, yRow, e) } Cood(xStart + (tiles.length - 1) * xStep, yRow) } expects a sequence of Multiple[A], but the implicit in the Multiple companion object allows us to pass straight values. implicit def toMultipleImplicit[A](value: A): Multiple[A] = Multiple(value, 1)
  3. I think it might be helpful to distinguish between Java / C# and C++. Objects in Java / C# means smart-objects which is an oxymoron. In Java Object orientated programming would be better called subject orientated programming. I played around a bit with C++ while trying to learn DirectX 11 at the same time. It was a bit of a steep learning curve. Anyway I abandoned that and got into C#. I soon started to fall in love with strongly typed code. It was amazing 50% of the time when my code compiled, it actually did what I wanted it to. My experience of C and C++, I did some C and Pascal way back, was that getting the code to compile was only, the beginning of a long painful journey. With C#I could rip my code apart, restructure and rewire (in other words refactor) and quickly get it to work again. I would even get the weird bug occasionally, where the code was doing what I wanted it to do, but I didn't know why. Its quite fun to try and track down why your code is working when it shouldn't be. But I was also frustrated by the lack of multiple inheritance and other short comings. C# was designed to be better than Java, but not too much better, as to become a threat to the C++ native Windows platform. So as soon as I came across Scala, with its quasi multiple inheritance it was good riddance to Microsoft, goodbye and thanks for all the fish. So from what I can make, from very limited knowledge, is that the problem with C++, was Bjarne's' "Not one CPU cycle left behind!" (relative to C). This was a great marketing slogan but a complete disaster in high level language design. You don't need 100% runtime efficiency, 80% is good enough and allows for huge beneficial trade off's in compile time safety, run time safety, compile times, reduced compiler bugs, the quality of tooling, ease of learning etc. And so the problem with smart object in c++ is that they are not very smart and can't even copy themselves properly. So I see it as a choice, or rather a balance, between smart objects and dumb data. Java's "Everything is a (smart)" object is dumb. Unfortunately Scala some what doubled down on this, but is now sensibly looking to back track. Silent boxing leads to criminal and unnecessary inefficiency. An Integer is dumb data data. An integer doesn't know, how to produce a string, convert itself to a double. An Int doesn't even know how to add itself to another Int. An requires operations to be applied to it. It has no methods. It has no identity. So to avoid boxing we must know the narrow type at compile time. However syntactically we can still write it as if these were methods. 5.toString myInt.toString So in Scala, there is usually a choice between trait / class based inheritance or type classes. Between a smart object that carries its methods around it with it to be dynamically dispatched at run time, or dumb data where operations must be applied at compile time. But the good thing is that you can still use type classes with smart objects, with objects that inherit from AnyRef. But also the type class instances that perform the operations on the different data types can themselves inherit.
  4. Rich Brighton

    Inspirations

    In a few weeks time, once I've upgraded my code to Scala 2.13 and I've sorted out my tooling story, I want to make a serious push to find collaborators. The natural way for me to begin that would be to start by describing both the old board games from decades ago and the video games that I have enjoyed playing. Ideally with a bit of a critique of what I liked and disliked. This is to help others identify if they share my passion for certain types of games. But also to explain why I feel there is an area of the video game design space that has been barely explored. Is this a legal no-no? Does it open myself and any future collaborators to being sued for copy right? I feel totally confident from a moral perspective that I'm not stealing anyone's hard work. In algorithmic terms, I actually find very little of use in the games I have played over the decades
  5. Rich Brighton

    Hexagonal movement

    Checkout my work here: https://richstrat.com/zug.html code at https://github.com/richtype/openstrat to convert from integer coordinates to regular 2d space you just multiply the y coordinate by the square root of 3. I have doubled up the integer coordinates to allow the hexagon tile sides to have integer coordinates. Most even moderately complex tile games require values for the tile sides as well as the tiles. So the hex side between Hex(10,10) and Hex(12, 12) is HexSide(11, 11). Under this system even the Hex tile vertices can be given a unique integer coordinate, which can be useful, although that requires a slightly more complex mapping. In the following yRatio is square root of 3: def coodToVec2(cood: Cood): Vec2 = coodToVec2(cood.x, cood.y) def coodToVec2(x: Int, y: Int): Vec2 = { def yAdj: Double = y * yRatio (x % 4, y % 4) match { case (xr, yr) if yr.isEven && xr.isEven => Vec2(x, yAdj) case (xr, yr) if yr.isEven => throw new Exception("HexCood, y is even but x is odd. This is an invalid HexCood") case (xr, yr) if xr.isOdd && yr.isOdd => Vec2(x, yAdj) case (0, 1) | (2, 3) => Vec2(x, yAdj + yDist /2) case (xr, yr) => Vec2(x, yAdj - yDist / 2) } }
  6. Rich Brighton

    Software for designing a 2D world map?

    You might find some of my work of interest: https://richstrat.com/ww2.html Code at: https://github.com/richtype/openstrat
  7. Rich Brighton

    Is it worth learning WPF now?

    I went for WPF over WinForms and am happy with that choice. I don't use xaml. xaml makes a right mess of your code structure and introduces partial classess which are horrendous. I also avoid the Application class. As for windows 8, the only reason to dance to microsofts tune is if you want to get on their App store. From what I can make out WinRt seems to be a big step down from WPF. As for writing apps in HTML5 and JS. Its great to see they've still got a sense of humour. Anyway Microsoft when you've got a sensible candidate for WPF replacement get back to me. Lets take C# 5.0, frameworlk 4.5# and visula studio 11, but I think I'll pass on Windows 8. That also means passing on bulldozer as windows 7 can't tell the differece between a separate core and a seperate Module, but no loss there eithor. Once Windows 8 has successfully flopped, we might be able to start looking forward to a new 64 bit XBox. Even if one doesn't intend to use Xna, it might be propt Microsoft to produce something usefullly new in terms of API
  8. I'm developing a strategy game in C# and that's coming along slowly but steadily. However I've felt for a long time that the UI would be vastly improved if I had 2 separated Mouse inputs. I'm currently using Windows Presentation Foundation for my GUI. The best solution I've come up with is to write an independent utility that would redirect the second mouse to the stylus pen. That would give me a mouse position and one button. Presumably a more sophisticated version could later be made later, where other mouse buttons were redirected to Touch gestures or Keyboard keys. I assume that C++ would be the obvious candidate to write the utility in as that's what windows is written and as well as the Direct Input documentation. My thinking was that even if I changed API to the Jupiter interface and maybe even to XNA the utility would still probably work. Is this a huge and incredibly difficult undertaking or should it be relatively simple and straightforward?
  9. Rich Brighton

    [.net] XAML inheritence - i r confused

    Maybe the mistake is using XAML. In the end I chose WPF for my first GUI with C#. I still feel that was the right choice rather than forms or XNA, but after a while I completely abandoned XAML. I found it messed up my programme structure. Every-things much cleaner witout it. I've just started using WCF for networking, seems good but again no XAML nonsense for me -everything in C#. No doubt there's many scenarios where code behind is minimal and XAML is highly productive and delivers good UI design, but I don't think its generally suited to the needs of game developers.
  10. Rich Brighton

    AMD Bulldozer: Good for gaming?

    I have read a few articles on Bulldozer but none have given an opinion on whether it will be well suited to gaming. The distinctive feature of the Bulldozer is the Module with its two integer cores and one floating point unit. Do games or certain types of games which are physics and graphics focused, rely heavily on floating point calculations? Will the extra Integers cores be sitting around idle? Is it possible to programme games and keep the number of floating point operations down, which are highly expensive in any case of system resources and processor time? Any thoughts appreciated!
  11. Rich Brighton

    Developing MultiPlayer functionality with c#

    Ah thanks for the advice. Aren't proxy objects better than messages then? As they allow you to programme your components Player interface, Core functionality AI, etc in an object orientated manner. Don't messages to some extent break the heavy type checking of c#. Which is its great beauty. Although I haven't done networking, obviously it must be able to deal with messages. I'm just a bit worried about designing around proxy objects and then discovering down the road that they don't work quite like how I imagined and having to rewrite non-network functionality. With proxy objects can I just pass in the proxy via a method/ constructor parameter same as a non proxy object. You recommend separate processes, if one is going to start playing around with multi-player? is it better to start with completely separate processes as opposed to multi threading or multiple application domains within the same process? I just checked and visual studio will seem to allow 2 versions of the project solution to run at the same time, so that should help. edit: Perhaps I should say that I've already got the multi-player infrastructure in place. so I could simulate multi-player just by opening another (non dialogue) window in WPF. As I'm learning, I don't mind restructuring and partly rewriting my code multiple times as my understanding and knowledge of the best solution increases, but I'd like to at least aim for the correct solution to start of with and I guess on reflection its the networking aspect rather the multi player aspect itself that concerns me.
  12. I'm building a Civilisation type game, but with simultaneous Turns / Real-time. I went with C# in the end. I'm loving the language and I'm at least familiar now with all major language features if far from experienced in their application. From the start I've tried to completely separate the core functionality from the GUI. For a short while I had 3 projects in my VS solution, the core, a windows forms project and a WPF one. For the time being I've got rid of forms and am just using WPF without XAML. It does what I want for the time being: puts Hex Shapes and Rectangles on the screen where I want them and allows me to easily interact them with clicks and context menus. So I have built a very basic scenario editor and am starting to build some very, very basic game play:just allowing units to move around. I've separated the description of the scenario, how things really are from the view of the scenario that the player sees. The player may not see everything and may even see units in the wrong place etc. So far I'm just working on Single Player on one machine. Now with the scenario editor, I'm happy that you can only edit a scenario on the local machine. However Game-play is different. I want the Player User Interface to work the same whether its on the same computer as the Core scenario Game processor or if its on a remote machine across the internet. So am I right in saying that I need to use messages? I presume there is no way to make it look like you're directly accessing methods on a local instantiated object unless you actually are. My thinking is that simple messages can be passed out by event. For the time being those messages can be passed on to the Core by the Player message handler using a simple method call. In the same way the Core can pass out messages to the player without knowing their destination by event and handled by the Cores Message handler. This way at later point hopefully I can write the networking functionality without having to touch the rest of the games functionality. Comments on the above appreciated, but also how easy is it to network some messages in C#? Is networking easy enough that you might as well introduce it earlier. Or should I simulate Multilayer through multiple processes on the same machine for the time being? Should I use Windows Communication Foundation or is it unnecessarily complicated? WCF does seem incredibly difficult to penetrate, worse even than C++ and DirectX 11.
  13. I've made some simple 2 D graphics in windows forms to display a hex grid and units counters. I'd got to a similar point on the UI using C++ and Directx11, before I decided to abandon the code and switch to C#, so I'm happy to switch again for a better long term solution. I'm trying to make a simple scenario/ world editor for a turn based strategy game. However I want to make the map area scrollable and combine it with other controls for data entry/display. I could do it by using multiple forms, but that feels messy, so I was thinking of gong over to WPF. I think, I'm finally starting to get to grips with WPF. Its supposed to have a steep learning curve. This seems mainly due to Microsoft's irritating habit of desgning everything around the complete novice and hiding everything but the flashy interface away. Meaning you waste loads of time as soon as you want / need to know what's actually going on. What the justification for hiding the 'main' function away is in a development tool beats me. Anyway any thoughts. I'm using C# so the options seem to be Forms, WPF or XNA. I understand integrating graphics and controls in XNA is even more difficult. Is this correct?
  14. Rich Brighton

    Coding 'Eloquence' - C#

    Just from a quick glance I'd put attackChoice as an enumerated type. I'm sure there are functions so you can actually display the object name, so you never have a manual conversion between values. Take's a bit more time to set up initially, but for me the beauty of c# is that you can so heavily type everything that you can get the compiler to do a huge amount of the validation of your code. I'm just learning myself, but its amazing how much of the time that when you've got it to compile, it actually does what you want it to do first time.
  15. I've got an abstract base class Hex and and I'm instantiating an array of Hex in an abstract base class Scenario. In the derived class ScenarioC I instantiate an array of HexC. HexC is derived from Hex namespace RichStrat { public abstract class Hex { public List<long> unitIds; } } namespace RichStrat { public class HexC: Hex { public Terr terr; public HexC() { terr = Terr.Plain; unitIds = new List<long> { }; } } } namespace RichStrat { public abstract class Scenario { public long xDim; public long yDim; public DateTime currGameTime; public Hex[,] hexs; public List<Unit> units; } } namespace RichStrat { public class ScenarioC: Scenario //The Core Database for the game scenario. Theoretically multiple secenarios can be loaded into memory at the same time { public HexC[,] hexs; /But when I comment this line out it still compiles public ScenarioU[] userView; // A database for every user and AI entity public ScenarioC(TestScenario t) { xDim = 4; yDim = 5; hexs = new HexC[xDim, yDim]; for (long x = 0; x < xDim; x++) { for (long y = 0; y < yDim; y++) hexs[x, y] = new HexC(); } units = new List<Unit> () {}; units.Add(new Unit(this, units.Count, 3,3)); } public void InitUserData() { } } } But when I comment out the line: public: HexC[,] hexs; // It still compiles. Haven't I just instantiated an abstract class? Edit: Ah silly me! I've just realised that I'm not instantiating any Hex only an array of Hex.Should I be using an interface instead here to force the derived Classes of scenario to implement a Hex derived Class?
  • 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!