Jump to content
  • Advertisement

lawnjelly

Member
  • Content count

    381
  • Joined

  • Last visited

  • Days Won

    3

lawnjelly last won the day on May 6

lawnjelly had the most liked content!

Community Reputation

1385 Excellent

5 Followers

About lawnjelly

  • Rank
    Member

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. lawnjelly

    Tower Defence video 2

    Thanks guys. Am looking forward to working on it again when I get back, now I have a lot of the 'basics' working I can try and make it a bit more strategic, encouraging playing for longer. I think the big danger with these type of games is making something that is fun to play for 5 mins, then you get bored. But if there is some kind of research tree or something like age of empires it encourages you to put the time in. Mind you I was only intending to spend a couple of weeks on it, and getting a working game at all is good in that time frame, so even a 5 minute install is a success lol. The other danger I think is getting carried away with eye candy and feature creep. Already I'm thinking, yeah if I have to abandon the terrain for performance and to keep the download size getting out of hand, I could use render to texture splatting to get the underlying land block to look more interesting, put some clouds or something for scrolling background, spend some time deciding where to put props around the villages so it doesn't look so blocky, etc etc. Have little villagers running around fixing your towers. Can always do that in version 2.0.
  2. lawnjelly

    Tower Defence video 2

    Just posting this quickly as I will be off for 5 days or so and unable to access PC / work on game, so a little update. Got sound working, although it needs some tweaking I need variations for the sounds but the programming side is all done. I have a sound manager that pools sound sources, don't know if that is more efficient than putting sound sources on all the gameobjects. I also figured out how to put animation events on the animations to play sounds in sync (footsteps, sword etc). Made a couple more quick towers in blender, although there is no separate logic for the towers yet, they are all firing same bullets etc. Changed from using my native huts to some medieval assets from Unity asset store. As these houses are bigger than one grid square there is now a bit more complex logic for placing them, rotating them until they fit on the map. Also the waypoints now lead to the front of the big building which will be your base (I might change the building model though). And added some particle effects. Made a pool system for these, and got the effects themselves again from asset store. There are small explosions, smoke (for your base when being hit), flames, and muzzle flashes, and blood (although this is my old test particle system I made). Did a little tweaking to the area camera to make sure more of the relevant action was 'in frame'. Although all the towers are firing the same so far, I will have them fire different projectiles at different speeds / damage / range. And maybe have some of the enemies attack the towers so you have to repair them. I've got a feeling play balancing might be a bit time consuming at the end, making it not too hard or too easy and having it get increasingly difficult as you progress...
  3. Is just a bit of fun, but I don't see why you can't put yours as an entry even if you are planning on selling your game after. Rutin, Awoken, Dexter and I are doing games I know of so far.
  4. This is looking very good already! You can do it as part of the gamedev challenge too, there are several of us making tower defence games at the moment.
  5. lawnjelly

    Tower Defense Challenge : Progress

    Wow is really shaping up, good going Dexter!
  6. lawnjelly

    Tower Defence first video

    Thanks guys! Been out all day today riding 200 miles in wales, should get some more done on the game tomorrow. Sound is working and music along with animation events on footsteps etc, and there is a 3rd enemy model now.
  7. lawnjelly

    Tower Defence first video

    Am just adding sound now, got music working and made a sound manager and now trying to put footsteps in the animations...
  8. lawnjelly

    Tower Defence first video

    Finally made a video: This doesn't have the terrain showing, I figured out it is quicker to make a build with terrain switched off, and it increases the filesize quite a bit so I might drop the terrain, not sure yet. I put in support yesterday for more than one enemy type, I have got a third type but haven't put in yet. These will have different strengths / health / speed. Also spent ages debugging yesterday from a nasty c# references bug, first time I've had to do any major debugging and it was difficult because I only have debug.log statements to rely on, as yet I have no debugging in monodevelop. The reason for the bug was because I'm using pooling for my game objects, so as not to new and create unity objects, they are just reused and position and visibility switched. So I have an intermediate 'reference' (another reference!) actor which stores which pooled actor of each type in is an actor slot. This makes it slightly more complex the adding and deleting actor code. Anyway when deleting an array element, I switched the last array element with the one to be deleted, then decrement the count. However, in c# the = operator does not copy the data like in c++, it copies the reference, so all kinds of unpredictable behaviour was resulting. Anyway, bug solved, crisis averted! I also put in some basic auto cameras. They work pretty well. There is an overview of the whole board, which does not change, a follow cam which zooms in on a particular actor, and an area cam, which treats all active actors as an area to focus on. The follow cam actually follows a point just ahead of the actor, because there is a delay from the smoothing. The area cam needs a little tweaking to get better. Next I need the other enemy type, and different tower types. And I need to put in a special big building or something for your base, maybe with some particle effects to show it being destroyed.
  9. lawnjelly

    Unity GameObjects arrays

    Thanks Nypyren. That's a good explanation. It is beginning to be become clearer. I'm using Unity on Linux, it's possible I botched the install as I had to install monodevelop separately, I might uninstall both and try and do at the same time once I've finished this tower defence game. So they have basically reversed the c++ convention for passing by value / passing by reference in C#. This begs the question, why would you do that (is this a carryover from java, I have not really used java)? And given it is possible to pass a struct by reference with the ref keyword, is it possible to pass a class by value with another keyword? What bugs me is not just the reversal of the convention that I'm used to, it is that when using a class / struct, you have to know which it is in order to understand what the code is doing. The result of a reference operation is completely different to an absolute operation, and it is not explicit in the code. Alright in c++ for example, you have to type one extra character (&, or *) in order to use 'reference' like access, but it makes it explicit in the code. You can (at least in theory) instantly understand what a line of code is doing, without having to refer to documentation. I think I get it now, but I'm sure it will bite me a few times before I get used to it!
  10. lawnjelly

    Unity GameObjects arrays

    Thanks Nypyren, I have read that using a 'struct' may be the answer to creating what would be considered normal programming code, I haven't tried it yet. I just spent 3 hours debugging yet another issue caused by these damn references. I have an array of a small class, and I wanted to copy one element to another, naturally I used a[x] = a[x+1], or similar code. This DOESN'T copy the element, as you would expect, it seems to copy the reference. WTF happens to the object that was there in a[x] I don't know, it possibly disappears into one of stephen hawkings' black holes, or into a secret missing sock stash. I spent ages trying to figure out if it was some bizarre multithreading bug, but no, C# doesn't actually seem to do basic language expressions. Instead I had to write a copy function into the class, in order to copy the object members (that weren't references) one by one, just to copy the F***ing data. Is there some kind of equivalent of memcopy that it's possible to use to copy data from an object to another? This isn't helped by the fact that my monodevelop install doesn't seem to want to debug with unity, so I can't see what's going on in the memory, and am relying on hundreds of verbose Debug.Logging statements. This language is hands down the worst I've ever used in 35 years.
  11. Yes, that old chestnut, we've all been there, where our optimization made things slower! It is well worth doing these experiments though, but the lesson is let the profiler be your guide. I often find that SIMD version isn't faster than scalar code, very often it is something else like memory bandwidth / cache that is limiting, hence why packing your data well can be such a win. The more you do it the more you get a feel for where the bottlenecks are likely to be, and of course, it is fun!
  12. lawnjelly

    Tower Defence

    This is a small tower defence game for the Gamedev challenge for fun and learning Unity.
  13. lawnjelly

    Tower Defence - Day 7

    I actually got to spend more time on tower defence game today. Things I got done In game UI - cash, enemies remaining and player base healthbar Cash system, paying for towers, bonus cash on completing level and killing enemies Waves of enemies (very rudimentary) Main menu and options menu, and changing from game to menu scenes Animations on completing a level, or having base destroyed It is all coming together now for the most basic version. Main things I still have to add Different enemies, wave variations Different towers Upgrading and repairing towers Sound But the basic version is almost completely playable now, I just have a small bug where it doesn't preserve cash between levels. The healthbars are also showing through a couple of the animations but I'll just hang them off an empty node tomorrow and cull them. I am quite pleased with what I have achieved in a week of part timing, with most of that spent watching tutorials and learning. Much I learned / copied from the brackeys tutorials in terms of basics of using Unity (https://www.youtube.com/user/Brackeys/videos), including some of the user interface stuff today. I can't wait to get some funky cameras going and perhaps doing some videos.
  14. Another obvious thing if you are writing rects that are bigger than the blocks, is to predetermine which will be completely filled, and only do the complex check for edge cases, and use a simpler routine for fully filled blocks. But then it depends on the proportion of completely filled boxes, as to whether this is a win, and as you say you are going down finally to the level of pixels. I'm presuming you done lots of profiling of this version versus more naive versions? What kind of results did you get? A comparison of a naive non SIMD line by line version versus the block version would be interesting. You could also try and make things branchless like you do in shaders and see if that helps. And I suspect you'd get more answers with a few more comments in the code, reading other people's intrinsics can be a little impenetrable lol!
  15. lawnjelly

    Tower Defence Days 4 & 5

    https://en.wikipedia.org/wiki/Distance This article explains better than I can. The most basic distance is the shortest distance between 2 points, this is Euclidean distance (as the crow flies). You get manhattan distance as explained earlier, although I made slight booboo it is abs(xdiff) + abs(ydiff) as negative values can cancel out. The square in pythagoras for euclidean distance takes care of this for you. There is also chessboard distance which works on a grid but allows diagonal moves as well as just up and down. You can combine approaches, there are no rules. Like use euclidean distance on a grid. In fact we could also potentially use bezier curves for the paths between the waypoints, it is slightly trickier to find the grid squares these cover though. You can also have a proper steering system for enemies, but then you have to deal with the numerous cases of enemies colliding with objects, which you avoid completely if you have them on rails (except for colliding with other enemies which I am not dealing with as yet).
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!