4 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

A boxing sim I made in Excel - what I learned

I hope it's OK to share a personal project. Apologies that this is quite a long post but I feel the need to release some thoughts that only people with an interest in Excel would understand.

A few weeks ago, another user made a post asking what everyone's biggest or proudest project was. Mine ended up being a boxing game that was still in its early stages.

I have now hit the milestone of having an actual working game engine. It has been a lot of fun building this, but it's also taken me two months of hacking away in the evenings. Honestly, I feel a bit of burnout. Crazy to think that I've spent more time on this than any project I've taken on at work!

Here is a gameplay demo: https://www.youtube.com/watch?v=xgM5LpYQUoU

Driving all of this is of course, a lot of VBA, but also lots of tables, dynamic arrays, nested ifs, XLOOKUPS, and INDEX/MATCH. I'm not a gamedev at all, so my biggest mistake was keeping a lot of game logic in formulae. This is just what feels natural to me, but in hindsight, the correct thing to do was probably to create arrays in VBA where possible. I feel like I'm past the point of no return with this.

INDEX/MATCH in particular was used a lot for strategy comparisons, by referring to lookup values on rows and columns. For example: the attacking and defending boxers have a given interaction, which compares one or more attributes - this assigns a base probability to each boxer winning that interaction. However, the probability can then be flexed by comparing say, the punch thrown vs the defender's guard style.

Dynamic arrays were really useful for helping to combine the result of different attacks into one consolidated range, which I was then able to use for the in-game commentary system.

Speaking of commentary, this was quite a laborious task because I created a unique code for each interaction outcome and then manually assigned descriptive words to each one. I did look into whether Copilot could be clever enough to generate descriptive commentary but I don't believe this is possible?

For the visual elements like buttons, and bar charts - I spent a lot of time trying to make things look pretty when I was procrastinating. Actually, one of the elements that I'm most proud of is the 'momentum' meter that can be viewed at the bottom of the screen. This is linked to the knockdown system. It took me a while to work out how to create the momentum chart but I remember seeing something similar on those charts that people use to show swings between two different political opinions.

Sound playback - I had some issue with the playback of one .wav file followed by another. For example, I needed to have crowd noise play immediately after the boxing bell ringing without any noticeable gap. From my research, I couldn't find a solution. In the end, I just asked ChatGPT to combine the files into one.

And lastly, probably the elephant in the room - use of AI. I simply would not have been able to make this project a few years ago without the help of LLMs. The biggest gain was streamlining parts of my code. The first version of VBA code I wrote to simulate a round took twice as long as the cleaned up version because I was repeating a lot of steps.

AI was used for the artwork of course. I'm slightly ashamed to do this but this is definitely just for fun and will never be a commercial project.

That's pretty much all of my thoughts laid out for now! There are a lot more features (game modes, AI decision making) that I would like to work on but it's time to take a break. I feel terrible that the time I've spent in the evenings would usually have been used for CPD courses (I'm an accountant and need to catch up on my hours now).

Thanks for reading if you got this far!

submitted by /u/superplex100
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#natural language processing for spreadsheets
#generative AI for data analysis
#rows.com
#real-time data collaboration
#real-time collaboration
#financial modeling with spreadsheets
#no-code spreadsheet solutions
#Excel compatibility
#Excel alternatives
#interactive charts
#natural language processing